diff options
author | 2019-01-08 21:41:11 +0100 | |
---|---|---|
committer | 2019-01-08 21:41:11 +0100 | |
commit | 6aab4ab890c0ca2f99bc615b7048533774f6ff68 (patch) | |
tree | 088d86001efa2a6d825ad51259a2df9b62b201fe /packages/forms/webpack.config.js | |
parent | wip (diff) | |
download | ferdium-app-6aab4ab890c0ca2f99bc615b7048533774f6ff68.tar.gz ferdium-app-6aab4ab890c0ca2f99bc615b7048533774f6ff68.tar.zst ferdium-app-6aab4ab890c0ca2f99bc615b7048533774f6ff68.zip |
Make packages work in electron, node and web
Diffstat (limited to 'packages/forms/webpack.config.js')
-rw-r--r-- | packages/forms/webpack.config.js | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/packages/forms/webpack.config.js b/packages/forms/webpack.config.js index 43deab722..8ad7ee3b6 100644 --- a/packages/forms/webpack.config.js +++ b/packages/forms/webpack.config.js | |||
@@ -1,41 +1,10 @@ | |||
1 | const path = require('path'); | 1 | const path = require('path'); |
2 | const TerserPlugin = require('terser-webpack-plugin'); | 2 | const baseConfig = require('../../webpack.config.base')(__dirname); |
3 | 3 | ||
4 | module.exports = { | 4 | module.exports = Object.assign({}, baseConfig, { |
5 | entry: path.join(__dirname, '/src/index.ts'), | ||
6 | context: __dirname, | ||
7 | output: { | 5 | output: { |
8 | filename: 'index.js', | 6 | filename: 'index.js', |
9 | path: path.join(__dirname, 'lib'), | 7 | path: path.join(__dirname, 'lib'), |
10 | libraryTarget: 'commonjs2', | 8 | libraryTarget: 'commonjs2', |
11 | }, | 9 | }, |
12 | module: { | 10 | }); |
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 | }; | ||