Copyright: no need to declare https://blog.csdn.net/Sun_Shydeo/article/details/89644356
1, page can not be displayed in the picture
The reason: loader treatment picture not installed
- Installation loader file-loader
npm i file-loader url-loader -D
- webpack.common.conf.js Configuration
- They were found in module --- rules to increase the allocation in the weexConfig and weexConfig
module: {
// webpack 2.0
rules: [
//...省略
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, //
loader: 'url-loader',
options: {
limit: 10000,
},
exclude: config.excludeModuleReg
},
//...省略
]
}
2. Click on the jump page does not display routing
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available
Initialization project configuration, there are two versions of the configuration of the operating environment: Compiler Version, Runtime version.
webpack.common.conf.js 配置: const webConfig = { resolve {alias}}
const webConfig = {
//省略
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': helper.resolve('src'),
vue: 'vue/dist/vue.js' //vue runtime
}
}
}