Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve webpack dev server #908

Merged
merged 2 commits into from
May 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
})
]
});