Webpack-dev-server serves old file content -


i have simple project:

appdir +- app +- main.js +- build +- bundle.js +- index.html +- webpack.config.js

the webpack.config.js:

var path=require("path");  module.exports = {     entry: path.resolve(__dirname, "./app/main.js"),     output: {         path: path.resolve(__dirname, "build"),         filename: "bundle.js"     } }; 

after changs main.js, webpack-dev-server seems detects change , performs rebundle bundle.js, browser still recieve old content of main.js.

i start server executing webpack-dev-server webpack.config.js

any ideas?

looking https://github.com/webpack/webpack-dev-server/issues/24 , add publicpath webpack.config.js , webpack serves bundle new content ^_^

var path=require("path");  module.exports = {     entry: path.resolve(__dirname, "./app/main.js"),     output: {         path: path.resolve(__dirname, "build"),         filename: "bundle.js",         publicpath: "/build/",     },     devserver: {     } }; 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -