-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.prod.js
24 lines (24 loc) · 1.06 KB
/
webpack.config.prod.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
var webpack = require('webpack');
var path = require('path');
var nodeModulesPath = path.resolve(__dirname, 'node_modules');
var buildPath = path.resolve(__dirname, 'client', 'build');
var mainPath = path.resolve(__dirname, 'client/src', 'main.js');
var config = {
devtool: 'source-map',
entry: mainPath,
output: { path: buildPath, filename: 'bundle.js', publicPath: '/client/build' },
module: {
loaders: [
{ test: [/\.js$/, /\.jsx$/], loader: 'babel-loader', exclude: [nodeModulesPath] },
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.(woff|woff2)$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
{ test: [/\.ttf$/, /\.eot$/, /\.svg$/], loader: "file-loader" }
]
},
plugins: [
new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery" }),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({ minimize: true, compress: { warnings: false } }),
new webpack.DefinePlugin({ 'process.env': {'NODE_ENV': JSON.stringify('production') } })
] };
module.exports = config;