-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
53 lines (50 loc) · 1.24 KB
/
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
48
49
50
51
52
53
var path = require('path')
const webpack = require("webpack");
const webpackModule = {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}, {
test: /\.css$/,
use: ['style-loader','css-loader?modules&importLoaders=1&localIdentName=[name]_[local]_[hash:base64:3]','postcss-loader']
}, {
test: /\.js$/,
exclude: /node_modules/,
enforce: 'pre',
loader: 'eslint-loader',
}
]
}
module.exports = [
{
name: 'lib',
entry: __dirname + '/src/index.js',
output: {
path: __dirname + '/lib',
filename: 'rater.js',
library: 'ReactRaterPlus',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: webpackModule,
externals: {
"react-css-themr": "commonjs react-css-themr",
"react": "commonjs react",
"react-dom": "commonjs react-dom",
"prop-types": "commonjs prop-types"
}
},{
name: 'example',
entry: __dirname + '/example/index.js',
output: {
path: __dirname + '/example',
filename: 'bundle.js'
},
devServer: {
contentBase: path.join(__dirname, "example"),
},
module: webpackModule
},
]