2018-02-17 00:00:06 +00:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
2017-12-14 16:21:45 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
2018-02-17 00:00:06 +00:00
|
|
|
main: path.resolve(__dirname, "client/main.js")
|
2017-12-14 16:21:45 +00:00
|
|
|
},
|
|
|
|
|
2018-07-09 21:49:35 +00:00
|
|
|
externals: {
|
|
|
|
react: "React",
|
|
|
|
"react-dom": "ReactDOM",
|
|
|
|
"react-router-dom": "ReactRouterDOM"
|
|
|
|
},
|
|
|
|
|
2017-12-14 16:21:45 +00:00
|
|
|
output: {
|
2018-02-17 00:00:06 +00:00
|
|
|
filename: "[name]-[hash:8].js",
|
|
|
|
path: path.resolve(__dirname, "public/_assets"),
|
|
|
|
publicPath: "/_assets/"
|
2017-12-14 16:21:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
rules: [
|
2018-07-09 21:49:35 +00:00
|
|
|
{ test: /\.js$/, exclude: /node_modules/, use: "babel-loader" },
|
2017-12-14 16:21:45 +00:00
|
|
|
{ test: /\.css$/, use: ["style-loader", "css-loader"] },
|
|
|
|
{ test: /\.md$/, use: ["html-loader", "markdown-loader"] },
|
2018-07-09 21:49:35 +00:00
|
|
|
{ test: /\.png$/, use: "file-loader" }
|
2017-12-14 16:21:45 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
2017-12-14 16:52:04 +00:00
|
|
|
new webpack.DefinePlugin({
|
2018-02-17 00:00:06 +00:00
|
|
|
"process.env.NODE_ENV": JSON.stringify(
|
|
|
|
process.env.NODE_ENV || "development"
|
|
|
|
)
|
|
|
|
})
|
2017-12-14 16:21:45 +00:00
|
|
|
],
|
|
|
|
|
2018-02-17 00:00:06 +00:00
|
|
|
devtool:
|
|
|
|
process.env.NODE_ENV === "production" ? false : "cheap-module-source-map"
|
|
|
|
};
|