标签:oba route src config 打包 import index nod 代码
在
build/webpack.prod.conf.js
的 output 节点添加配置:publicPath: ‘./‘
在入口 build/build.js
中使用.
require(‘shelljs/global‘)
cp(‘-R‘, ‘favicon.ico‘, config.build.assetsRoot)
_import_production.js 代码
module.exports = file => () => import(‘@/views/‘ + file + ‘.vue‘)
_import_testing.js 代码
module.exports = file => () => import(‘@/views/‘ + file + ‘.vue‘)
_import_development.js 代码
module.exports = file => require(‘@/views/‘ + file + ‘.vue‘).default
路由中使用
const _import = require('./_import_' + process.env.NODE_ENV)
...
component: _import('dashboard/index')
...
标签:oba route src config 打包 import index nod 代码
原文地址:https://www.cnblogs.com/morang/p/9074983.html