-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.babel.js
51 lines (49 loc) · 1.52 KB
/
webpack.config.babel.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
import webpack from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import path from 'path';
export default {
devtool: 'source-map',
entry: {
helloworld: './es6-jsx-examples/helloworld.js',
timer: './es6-jsx-examples/timer.js',
'connect-redux-to-react': './connect-redux-to-react/index.js',
'react-form': './react-form/index.js',
'simple-redux-form': './simple-redux-form/index.js',
'example-page': './jsx-exercise/index.js',
'react-giphy-search': './react-giphy-search/index.js',
'redux-giphy-search': './redux-giphy-search/index.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
devServer: {
stats: 'minimal',
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
// Really important to ensure react runs in production mode when you ran
// `export NODE_ENV=production` before running webpack. Also note that
// exposing your entire process.env is a major security risk.
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
},
}),
new CopyWebpackPlugin([
{ from: 'connect-redux-to-react/connect-redux-to-react.html' },
{ from: 'es6-jsx-examples/helloworld.html' },
{ from: 'es6-jsx-examples/timer.html' },
{ from: 'simple-redux-form/simple-redux-form.html' },
{ from: 'jsx-exercise/example-page.html' },
]),
],
};