【发布时间】:2018-12-08 12:08:39
【问题描述】:
您好,我是 webapck 和 vue 的新手,我正在尝试让热模块重新加载工作,以便我的页面随着更改而更新。目前,当我 ctrl f5 页面时它可以工作。
我正在使用一个通过 IIS 运行该站点的 asp.net 核心站点,如果这会有所不同的话。
我使用这个答案来启动并运行 vue:
https://*.com/a/49428220/66975
这是我的 webpack.config.js:
const { VueLoaderPlugin } = require('./node_modules/vue-loader')
module.exports = {
entry: './Vue/index.js',
output: {
path: __dirname,
filename: './wwwroot/js/bundle.js'//'./Vue/dist/bundle.js'
},
watch: true,
plugins: [
new VueLoaderPlugin()
],
devtool: 'source-map',
module: {
rules: [
{
test: /\.vue$/,
exclude: /node_modules/,
loader: 'vue-loader'
}
]
}
};
包json:
{
"name": "WebApplication13",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"vue-loader": "^15.2.4",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.12.0"
},
"dependencies": {
"vue": "^2.5.16"
}
}
【问题讨论】:
标签: webpack asp.net-core vue.js