-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
42 lines (39 loc) · 1 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
var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'build/js/');
var SRC_DIR = path.resolve(__dirname, 'src/');
var config = {
entry: [
SRC_DIR + '/index.jsx'
],
output: {
path: BUILD_DIR,
filename: '[name].js',
chunkFilename: "[id].js"
},
resolve: {
extensions: ['', '.jsx', '.scss', '.js', '.json', '.css'], // along the way, subsequent file(s) to be consumed by webpack
modulesDirectories: [
'node_modules',
]
},
plugins: [
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{
test: /\.jsx?$/,
loaders: ['babel-loader'],
include: SRC_DIR,
exclude: /node_modules/
},
{
test: /\.s?css$/,
loaders: ['style', 'css', 'sass'],
include: SRC_DIR
}
]
}
};
module.exports = config;