This repository has been archived on 2020-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
2018-12-03 21:44:11 +00:00
|
|
|
const merge = require("webpack-merge");
|
|
|
|
const path = require("path");
|
|
|
|
const CleanWebpackPlugin = require("clean-webpack-plugin");
|
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
|
|
|
|
|
|
const common = require("./webpack.common");
|
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
mode: "development",
|
|
|
|
|
|
|
|
output: {
|
|
|
|
filename: "[name].js",
|
|
|
|
chunkFilename: "[id].css"
|
|
|
|
},
|
|
|
|
|
|
|
|
devServer: {
|
|
|
|
port: process.env.PORT || 3000,
|
|
|
|
contentBase: path.join(process.cwd(), "./dist"),
|
|
|
|
watchContentBase: true,
|
|
|
|
quiet: false,
|
|
|
|
open: true,
|
|
|
|
historyApiFallback: {
|
|
|
|
rewrites: [{from: /./, to: "404.html"}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
2019-03-28 05:01:31 +00:00
|
|
|
new CleanWebpackPlugin({
|
|
|
|
cleanOnceBeforeBuildPatterns: [
|
|
|
|
"dist/**/*.js",
|
|
|
|
"dist/**/*.css",
|
|
|
|
"site/content/webpack.json"
|
|
|
|
]}),
|
2018-12-03 21:44:11 +00:00
|
|
|
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
filename: "[name].css",
|
|
|
|
chunkFilename: "[id].css"
|
|
|
|
})
|
|
|
|
]
|
|
|
|
});
|