-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.deployment.config.js
More file actions
57 lines (54 loc) · 1.26 KB
/
Copy pathwebpack.deployment.config.js
File metadata and controls
57 lines (54 loc) · 1.26 KB
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
55
56
57
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const GLOBALS = {
'process.env.NODE_ENV': JSON.stringify('production')
};
module.exports = {
devtool: 'source-map',
entry: path.resolve(__dirname, 'client/src/index.js'),
resolve: {
extensions: ['.js', '.jsx']
},
target: 'web',
output: {
path: path.resolve(__dirname, 'client/public'),
publicPath: '/',
filename: 'bundle.min.js'
},
plugins: [
new webpack
.optimize
.OccurrenceOrderPlugin(),
new webpack.DefinePlugin(GLOBALS),
new ExtractTextPlugin('styles.css'),
new webpack
.optimize
.UglifyJsPlugin({ sourceMap: true, minimize: true })
],
module: {
loaders: [
{
test: /(\.css)$/,
use: ExtractTextPlugin.extract({ use: 'css-loader' })
}, {
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: ['css-loader', 'sass-loader']
})
}, {
test: /\.(js|jsx)$/,
loader: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.(woff|woff2)$/,
loader: 'url?prefix=font/&limit=5000'
}
]
},
node: {
dns: 'empty',
net: 'empty',
fs: 'empty'
}
};