-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.config.js
54 lines (52 loc) · 1.2 KB
/
webpack.production.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
const webpack = require('webpack');
const path = require('path');
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'cheap-source-map',
entry: [
path.resolve(__dirname, 'app/main.jsx'),
],
output: {
path: `${__dirname}/build`,
publicPath: '/',
filename: './bundle.js'
},
module: {
loaders: [
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
},
{
test: /\.js[x]?$/,
include: path.resolve(__dirname, 'app'),
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif)(\?\S*)?$/,
loader: 'url?limit=100000@name=[name][ext]'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
plugins: [
new webpack.optimize.DedupePlugin(),
new UglifyJsPlugin({
compress: {
warnings: false
}
}),
new CopyWebpackPlugin([
{ from: './app/index.html', to: 'index.html' },
{ from: './app/main.css', to: 'main.css' }
]),
]
};