Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (51 loc) · 1.42 KB
/
Copy pathwebpack.config.js
File metadata and controls
54 lines (51 loc) · 1.42 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
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpack = require('webpack');
var environment = process.env.NODE_ENV || 'development';
module.exports = {
entry: './src/App.jsx',
output: {
filename: './dist/build.js'
},
resolve: {
root: __dirname,
alias: {
// Component: 'app/components/Component.jsx',
},
extensions: ['', '.js', '.jsx'],
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-2']
}
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('css!sass')
}
// {
// test: /\.jpe?g$|\.gif$|\.png$/i,
// loader: "file-loader?name=/img/[name].[ext]"
// }
// {
// test: /\.otf$/,
// loader: "file-loader?name=/fonts/Brown/[name].[ext]"
// }
]
},
devtool: 'eval-source-map',
plugins: [
new ExtractTextPlugin('./src/css/style.css', {
allChunks: true
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(environment)
}
})
]
};