-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
58 lines (56 loc) · 1.6 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
"use strict"; // eslint-disable-line strict
const path = require("path");
const webpack = require("webpack");
const WebpackNotifierPlugin = require("webpack-notifier");
module.exports = {
devtool: "source-map",
entry: ["babel-polyfill", "./src/client/index.js"],
output: {
path: path.join(__dirname, "src", "public", "js"),
filename: "bundle.js",
publicPath: path.join(__dirname, "src", "public", "js")
},
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("development") // eslint-disable-line quote-props
}
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
Popper: ["popper.js", "default"],
Util: "exports-loader?Util!bootstrap/js/dist/util",
Dropdown: "exports-loader?Dropdown!bootstrap/js/dist/dropdown"
}),
new WebpackNotifierPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
loaders: [
{
test: /\.js$/,
loader: "babel-loader",
query: {
presets: ["react", ["env", { targets: { browsers: ["last 2 Chrome versions"] } }]], // eslint-disable-line quote-props
plugins: ["transform-flow-strip-types", "lodash"]
},
exclude: /node_modules/
},
{
test: /\.(css|scss)$/,
loaders: ["style-loader", "css-loader", "sass-loader"]
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: "file-loader"
},
{
test: /\.(woff|woff2|ttf|svg)$/,
loader: "url-loader"
}
]
}
};