-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
53 lines (50 loc) · 1.34 KB
/
webpack.config.js
File metadata and controls
53 lines (50 loc) · 1.34 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
/**
* Created by isuhar on 13.11.16.
*/
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var DEBUG = process.env.NODE_ENV !== 'production' ? true : false;
var config = {
entry: './assets/main.jsx',
output: {
path: __dirname + '/public/',
publicPath: '/',
filename: '[name].js'
},
module: {
loaders: [
{
test: /.jsx?$/,
loader: ['babel-loader'],
exclude: /node_modules/,
query: {
presets: DEBUG ? [ 'es2015', 'react' ] : [ 'es2015', 'react']
}
},
{
test: /\.scss$/,
loader: DEBUG ? 'style!css!sass' : ExtractTextPlugin.extract('css!sass')
},
{
test: /\.woff2?$|\.ttf$|\.eot$|\.svg$|\.png|\.jpe?g|\.gif$/,
loader: 'file-loader'
}
]
},
plugins: [
new ExtractTextPlugin('[name].css', {
allChunks: true,
disable: process.env.NODE_ENV === 'development'
})
],
devServer:{
contentBase: 'web',
devtool: 'eval',
proxy: {
'*': 'http://localhost:3000'
}
},
devtool: 'eval'
};
module.exports = config;