-
Notifications
You must be signed in to change notification settings - Fork 158
/
webpack.lib.config.js
56 lines (49 loc) · 1.02 KB
/
webpack.lib.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
48
49
50
51
52
53
54
55
56
const webpack = require('webpack')
const path = require('path')
const PATH_ROOT = path.resolve(__dirname, './')
const PATH_SRC = path.resolve(PATH_ROOT, 'src/')
const PATH_OUT = path.resolve(PATH_ROOT, 'dist/')
module.exports = {
mode: 'production',
entry: [path.resolve(PATH_SRC, 'index.js')],
output: {
path: PATH_OUT,
filename: 'index.js',
library: 'ReactMic',
libraryTarget: 'umd'
},
module: {
rules: [
{
test: /\.js$/,
loaders: ['babel-loader'],
exclude: /node_modules/
}
]
},
externals: {
'react': {
root: 'React',
commonjs: 'react',
commonjs2: 'react'
},
'prop-types': {
root: 'PropTypes',
commonjs: 'prop-types',
commonjs2: 'prop-types'
},
'react-dom': {
root: 'ReactDOM',
commonjs: 'react-dom',
commonjs2: 'react-dom'
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: 'production'
},
__DEVELOPMENT__: false
})
]
}