Debian Codegraph @

webpack.dev.js

raw
1 const path = require("path");
2 const merge = require("webpack-merge");
3 const exec = require("child_process").exec;
4 const WatchPlugin = require("webpack-watch-files-plugin").default;
5 const ShellPlugin = require("webpack-shell-plugin");
6 const common = require("./webpack.common.js");
7
8 module.exports = merge(common, {
9 mode: "development",
10 watch: true,
11 // The dev server uses both contentBase and publicPath. The contentBase is
12 // used to server the built docs, and publicPath is the bundle path for live
13 // reloading. The publicPath intercepts requests to the static assets in
14 // _static/. Opening http://localhost:1919 is everything you need for
15 // development.
16 devServer: {
17 contentBase: "docs/build/html",
18 port: 1919,
19 open: false,
20 hot: false,
21 liveReload: true,
22 publicPath: "/_static/",
23 disableHostCheck: true,
24 headers: {
25 "Access-Control-Allow-Origin": "*"
26 }
27 },
28 plugins: [
29 new WatchPlugin({
30 files: ["./docs/**/*.rst", "./docs/**/*.py"]
31 }),
32 new ShellPlugin({
33 onBuildStart: ["make -C docs clean html"],
34 })
35 ]
36 });