diff options
Diffstat (limited to 'packages/forms/webpack.config.js')
-rw-r--r-- | packages/forms/webpack.config.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/packages/forms/webpack.config.js b/packages/forms/webpack.config.js new file mode 100644 index 000000000..43deab722 --- /dev/null +++ b/packages/forms/webpack.config.js | |||
@@ -0,0 +1,41 @@ | |||
1 | const path = require('path'); | ||
2 | const TerserPlugin = require('terser-webpack-plugin'); | ||
3 | |||
4 | module.exports = { | ||
5 | entry: path.join(__dirname, '/src/index.ts'), | ||
6 | context: __dirname, | ||
7 | output: { | ||
8 | filename: 'index.js', | ||
9 | path: path.join(__dirname, 'lib'), | ||
10 | libraryTarget: 'commonjs2', | ||
11 | }, | ||
12 | module: { | ||
13 | rules: [{ | ||
14 | test: /\.tsx?$/, | ||
15 | loader: 'ts-loader', | ||
16 | exclude: /node_modules/, | ||
17 | }], | ||
18 | }, | ||
19 | resolve: { | ||
20 | extensions: ['.tsx', '.ts', '.js'], | ||
21 | }, | ||
22 | externals: { | ||
23 | '@meetfranz/theme': '@meetfranz/theme', | ||
24 | lodash: { | ||
25 | commonjs: 'lodash', | ||
26 | commonjs2: 'lodash', | ||
27 | amd: 'lodash', | ||
28 | root: '_', | ||
29 | }, | ||
30 | classnames: 'classnames', | ||
31 | mobx: 'mobx', | ||
32 | mobxReact: 'mobx-react', | ||
33 | react: 'react', | ||
34 | reactJss: 'react-jss', | ||
35 | }, | ||
36 | devtool: 'inline-source-map', | ||
37 | optimization: { | ||
38 | minimizer: [new TerserPlugin()], | ||
39 | }, | ||
40 | mode: process.env.NODE_ENV === 'development' ? 'development' : 'production', | ||
41 | }; | ||