Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
Latest commit
90 lines (81 loc) · 1.81 KB
/
Copy pathwebpack.config.js
File metadata and controls
90 lines (81 loc) · 1.81 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
* External dependencies
*/
varwebpack=require('webpack'),
autoprefixer=require('autoprefixer'),
NODE_ENV=process.env.NODE_ENV||'development',
path=require('path');
constCleanWebpackPlugin=require('clean-webpack-plugin');
constHtmlWebpackPlugin=require('html-webpack-plugin');
varconfig={
mode: NODE_ENV,
entry: {
'bundle' : [
'./src'
]
},
output: {
path: path.join(__dirname,'build'),
publicPath: '/build/',
filename: '[name].js',
devtoolModuleFilenameTemplate: 'app:///[resource-path]'
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
include: path.join(__dirname,'/src')
},
{
test: /\.scss$/,
loaders: [
'isomorphic-style-loader',
'css-loader?modules&importLoaders=1&localIdentName=[path][local]&camelCase=dashes&sourceMap',
'postcss-loader',
'sass-loader?sourceMap'
]
}
],
},
resolve: {
extensions: ['.json','.js','.jsx']
},
node: {
console: false,
process: true,
global: true,
Buffer: true,
__filename: 'mock',
__dirname: 'mock',
fs: 'empty'
},
plugins: [
newwebpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(NODE_ENV),
BROWSER: JSON.stringify(true)
}
}),
]
};
if(process.env.NODE_ENV!=='production'){
// Switches loaders to debug mode. This is required to make CSS hot reloading works correctly (see
// http://bit.ly/1VTOHrK for more information).
//config.debug = true;
// Enables source maps
config.devtool='eval';
config.devServer={
hot: true,
port: 7777,
historyApiFallback: true
};
/*config.module.rules.unshift( {
test: /\.jsx?$/,
loader: 'react-hot-loader/webpack',
include: path.join( __dirname, '/src' ),
exclude: /node_modules/,
} );*/
}
module.exports=config;