diff options
author | Anthony Johnson <aj@ohess.org> | 2020-05-02 05:17:59 +0300 |
---|---|---|
committer | Anthony Johnson <aj@ohess.org> | 2020-05-02 05:38:10 +0300 |
commit | 0eab0dcbdfd3fddc4a76aec1bb2f8abb7f888036 (patch) | |
tree | 3124aa1c1808edee930817f75c30e1bacc381be3 /webpack.dev.js | |
parent | 35034930943c38e6f839ad89a4e3bcba811010d5 (diff) |
Make webpack dev server config to be more useful
Don't rebuild the docs constantly, use the nice webpack livereload
feature instead. Changes are now instantaneous when working with CSS/JS
Diffstat (limited to 'webpack.dev.js')
-rw-r--r-- | webpack.dev.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/webpack.dev.js b/webpack.dev.js index ec8c2d6..b01723e 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -8,24 +8,29 @@ const common = require("./webpack.common.js"); module.exports = merge(common, { mode: "development", watch: true, + // The dev server uses both contentBase and publicPath. The contentBase is + // used to server the built docs, and publicPath is the bundle path for live + // reloading. The publicPath intercepts requests to the static assets in + // _static/. Opening http://localhost:1919 is everything you need for + // development. devServer: { - contentBase: path.join(__dirname, "docs/build/html"), - watchContentBase: true, - compress: false, + contentBase: "docs/build/html", port: 1919, + open: false, hot: false, liveReload: true, - publicPath: "/_static/" + publicPath: "/_static/", + disableHostCheck: true, + headers: { + "Access-Control-Allow-Origin": "*" + } }, plugins: [ new WatchPlugin({ files: ["./docs/**/*.rst", "./docs/**/*.py"] }), new ShellPlugin({ - onBuildEnd: ["make -C docs clean html"], - // dev=false here to force every build to trigger make, the default is - // first build only. - dev: false + onBuildStart: ["make -C docs clean html"], }) ] }); |