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: {
}
}
]
}
};
通过上述配置,如果我跑的WebPack,它会得到一个正确的结果,但如果我跑的WebPack-dev的服务器 ,在index.js源代码不会被transpiled到ES5.In换句话说,巴贝尔装载机只有作品时的WebPack,但不是的WebPack-DEV-服务器 。
为什么?