-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
49 lines (40 loc) · 1.16 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
var webpack = require('webpack');
var rootDir = __dirname;
var nodeDir = rootDir + '/node_modules/';
module.exports = {
context: rootDir, // a base directory to resolve the “entry”
entry: {
main: 'main.js'
},
output: {
path: './js/built/',
publicPath: './js/built/',
filename: "[name].js" // [name] means we are going to use the "key" value of each entry as the bundle file name
},
resolve: {
extensions: ['', '.js', '.jsx'], // resolve file extentions so that we don't have to specify the extention for js and jsx files,
modulesDirectories: ['node_modules', 'js', 'scss']
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'common',
filename: 'common.js'
}),
new webpack.ProvidePlugin({
// $: "jquery",
// jQuery: "jquery",
// ScrollMagic: 'scrollmagic'
})
],
module: {
loaders: [
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
}
]
},
sassLoader: {
includePaths: rootDir + '/sass/'
}
};