發(fā)布工程
配置好config文件內(nèi)index.js中build模塊
assetsPublicPath: './',
發(fā)布
npm run build
執(zhí)行完成后生成dist文件夾提交到服務(wù)器棵譬,完成發(fā)布
URL中去除末尾#,在路由中添加 mode: 'history',
export default new Router({
mode: 'history',
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
}
]
})
WebStorm格式化Cmd+Option+L導(dǎo)致Vue格式警告錯(cuò)誤問題
找到build文件夾下webpack.base.conf.js注釋該方法處理
const createLintingRule = () => ({
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter'),
// emitWarning: !config.dev.showEslintErrorsInOverlay
// }
})
重啟項(xiàng)目末购,結(jié)束