1.新建、运行
vue create vue-ebooks
npm run serve
2.打包文件
npm run build
双击打开 dist/index.html
会发现资源加载失败
根目录新建vue cli(v3.3)配置文件 vue.config.js ,配置 开发和发布 的资源路径
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? './'
: '/'
}
https://cli.vuejs.org/config/#publicpath
3.支持sass
cnpm i --save-dev node-sass sass-loader