-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
53 lines (50 loc) · 1.59 KB
/
webpack.dev.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
"use strict";
const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
devtool: "source-map",
// resolve: {
// alias: {
// "mobx-state-router": path.resolve(__dirname, "mobx-state-router/dist")
// }
// },
entry: {
app: [
"./application/index.js"
],
},
output: {
path: __dirname + "/public/static",
filename: "[name].js",
chunkFilename: "[name]-[id].js", // or whatever other format you want.
publicPath: "/",
library: "[name]",
libraryTarget: "umd"
},
plugins: [
new HtmlWebpackPlugin({
template: __dirname + "/application/template/index.tpl.html",
inject: "body",
filename: "index.html"
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
rules: [
{
test: /\.(js|jsx)$/,
loader: require.resolve('babel-loader'),
options: {
// This is a feature of `babel-loader` for Webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
// plugins: ['transform-decorators-legacy', 'transform-class-properties', 'react-hot-loader/babel'],
// presets: ['env', 'react']
},
}
]
}
};