-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
64 lines (57 loc) · 1.64 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// path is part of nodejs
var webpack = require('webpack');
var path = require('path');
// var CommonsChunkPlugin = require('./node_modules/webpack/lib/optimize/CommonsChunkPlugin');
const PATHS = {
build : path.join(__dirname, 'build'),
dist : path.join(__dirname, 'dist'),
public : path.join(__dirname, 'public'),
src : path.join(__dirname, 'src')
};
/*
src is the old folder where the files were before they were
combined dist is the new folder where the files live that MAY
or MAYNOT not going to be combined build is the new folder
where files that get combined are put
*/
console.log(' * * * * * ** ', path.join(PATHS.src, 'index.js'));
module.exports = {
entry: path.join(PATHS.src, 'index.js'),
output: {
path : path.join(__dirname, 'public/j'),
filename : 'main.bundle.js'
},
devServer: {
inline : true,
contentBase : PATHS.public,
port : 3001,
historyApiFallback : true
},
module: {
loaders: [
{
test: /\.css$/,
loader:'style-loader!css-loader'
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader?limit=20000'
// this means that if its larger than 20k it gives it is direct url
// but what does that mean??
},
{
test: /\.js?$/,
exclude: /(node_modules)/,
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['react', 'es2015']
}
}
]
}
// ,
// plugins: [
// new CommonsChunkPlugin('commons', 'commons.bundle.plugin')
// ]
};