forked from srn/react-webpack-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.base.config.js
61 lines (48 loc) · 1.24 KB
/
webpack.base.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var webpack = require('webpack');
var path = require('path');
var objectAssign = require('object-assign');
var NODE_ENV = process.env.NODE_ENV;
var env = {
production: NODE_ENV === 'production',
staging: NODE_ENV === 'staging',
test: NODE_ENV === 'test',
development: NODE_ENV === 'development' || typeof NODE_ENV === 'undefined'
};
objectAssign(env, {
build: (env.production || env.staging)
});
module.exports = {
target: 'web',
entry: './client/entry.jsx',
output: {
path: path.join(process.cwd(), '/client'),
pathInfo: true,
publicPath: 'http://localhost:3000/client/',
filename: 'main.js'
},
resolve: {
modulesDirectories: [
'web_modules',
'node_modules',
'client'
],
extentions: ['js', 'jsx', 'scss']
},
plugins: [
new webpack.DefinePlugin({
__DEV__: env.development,
__STAGING__: env.staging,
__PRODUCTION__: env.production,
__CURRENT_ENV__: '\'' + (NODE_ENV) + '\''
})
],
module: {
preLoaders: [
{test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/}
],
loaders: [
{test: /\.scss$/, loader: 'style!css!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded'}
],
noParse: /\.min\.js/
}
};