forked from readmeio/markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
47 lines (43 loc) · 985 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const TerserPlugin = require('terser-webpack-plugin');
const { merge } = require('webpack-merge');
const common = require('./webpack.common');
const browserConfig = merge(common, {
entry: './index.js',
externals: {
'@readme/variable': '@readme/variable',
'@tippyjs/react': '@tippyjs/react',
react: {
amd: 'react',
commonjs: 'react',
commonjs2: 'react',
root: 'React',
umd: 'react',
},
'react-dom': {
amd: 'react-dom',
commonjs2: 'react-dom',
commonjs: 'react-dom',
root: 'ReactDOM',
umd: 'react-dom',
},
},
output: {
library: {
type: 'umd',
},
},
optimization: {
minimize: false,
minimizer: [new TerserPlugin()],
},
resolve: {
fallback: { path: require.resolve('path-browserify') },
},
});
const serverConfig = merge(browserConfig, {
target: 'node',
output: {
filename: '[name].node.js',
},
});
module.exports = [browserConfig, serverConfig];