var path = require("path");
module.exports = {
entry: "./src/index.js",
output: {
filename: "index.js",
path: path.resolve(__dirname, "./built/"),
publicPath: "/built/"
},
plugins: [],
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader"
},
{
test: /\.vue$/,
loader: "vue-loader",
options: {
}
}
]
}
};
With the above configuration,if I run webpack,it will get a correct result,but if I run webpack-dev-server,the source code in index.js will not been transpiled to ES5.In other words,babel-loader only works when webpack,but not webpack-dev-server.
why?