-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
54 lines (52 loc) · 1.12 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
54
/* eslint-disable no-var */
var path = require('path');
var nodeExternals = require('webpack-node-externals');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'./src/index.js'
],
externals: [nodeExternals({
modulesFromFile: true
})],
mode: 'production',
optimization: {
minimize: true
},
performance: {
hints: false
},
output: {
libraryTarget: 'commonjs2',
path: path.join(__dirname, 'lib'),
filename: 'index.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: ['transform-runtime'],
presets: [
'es2015',
'react',
'stage-0'
]
}
}
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: 'css-loader?modules&importLoaders=1&localIdentName=draftJsGiphyPlugin__[local]__[hash:base64:5]!postcss-loader'
})
}
]
},
plugins: [
new ExtractTextPlugin('plugin.css')
]
};