-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.js
52 lines (48 loc) · 1.53 KB
/
webpack.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
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var bourbon = require('node-bourbon');
var LiveReloadPlugin = require("webpack-livereload-plugin");
var WebpackNotifierPlugin = require('webpack-notifier');
var bourbon_include_paths = "includePaths[]=" + bourbon.includePaths.join("&includePaths[]=");
module.exports = {
entry: __dirname + "/static/js/index.js",
devtool: "cheap-source-map",
output: {
path: __dirname + "/static/assets",
pathinfo: true,
filename: "index.js",
publicPath: "/static/assets/"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader?optional=runtime&loose"
},
{
test: /\.scss$|\.css$/,
loader: ExtractTextPlugin.extract("css!sass?" + bourbon_include_paths)
},
{
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$/,
loader: "file"
}
]
},
resolve: {
modulesDirectories: [
__dirname + "/static/js",
__dirname + "/static/scss",
"node_modules",
]
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new ExtractTextPlugin("styles.css", { allChunks: true }),
new LiveReloadPlugin(),
new WebpackNotifierPlugin({
title: "Webpack Build Complete", alwaysNotify: true
})
]
};