-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
36 lines (35 loc) · 903 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
const path = require('path')
const ExtractTextWebpackPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'lib'),
libraryTarget: 'commonjs2'
},
externals: /^(react|babel-runtime)/,
module: {
rules: [
{
test: /\.jsx?$/,
use: ['babel-loader'],
exclude: path.resolve(__dirname, 'node_modules')
},
{
test: /\.css$/,
use: ExtractTextWebpackPlugin.extract({
use: ['css-loader']
})
}
]
},
plugins: [
new ExtractTextWebpackPlugin({
filename: 'style.css'
})
],
devtool: 'source-map',
resolve: {
extensions: ['.js', '.jsx']
}
}