git.iko.soy/rowtype-yoga/psfp
on 3823f3f help sign in
40 lines 1.0 kB history raw
1const webpack = require("webpack");
2const merge = require("webpack-merge");
3const path = require("path");
4const common = require("./webpack.common.js");
5const HtmlWebpackPlugin = require("html-webpack-plugin");
6const isWebpackDevServer = process.argv.some(
7 (a) => path.basename(a) === "webpack-dev-server"
8);
9const isWatch = process.argv.some((a) => a === "--watch");
11const plugins =
12 isWebpackDevServer || !isWatch
13 ? []
14 : [
15 function () {
16 this.plugin("done", function (stats) {
17 process.stderr.write(stats.toString("errors-only"));
18 });
19 },
20 ];
21module.exports = merge(common, {
22 mode: "development",
23 devtool: "eval-source-map",
25 devServer: {
26 contentBase: path.resolve(__dirname, "dist"),
27 port: 4008,
28 stats: "errors-only",
29 },
31 plugins: [
32 new webpack.LoaderOptionsPlugin({
33 debug: true,
34 }),
35 new HtmlWebpackPlugin({
36 title: "Purescript Fan Page",
37 template: "index.html",
38 }),
39 ].concat(plugins),
40});