forked from DailyCheckup/DailyCheckup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
45 lines (44 loc) · 1.14 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
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const WebpackStrip = require('strip-loader');
module.exports = {
devtool: 'source-map',
entry: './src/Components/index',
// This will not actually create a bundle.js file in ./client. It is used
// by the dev server for dynamic hot loading.
output: {
path: __dirname + '/build/',
filename: 'build.js',
},
// entry:'./src/main.jsx',
// output: {
// path: './client',
// filename: 'bundle.js'
// },
resolve: {
extensions: ['', '.js', '.jsx'],
},
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['babel-loader?presets[]=react,presets[]=es2015',
WebpackStrip.loader('console.log')],
exclude: /node_modules/,
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('css!sass'),
}],
},
plugins: [
new ExtractTextPlugin('build.css', { allChunks: true }),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),
],
};