Vue-cli3项目配置

2018-09-26 21:22

阅读:742

  Vue-cli3 搭建的项目 界面想对之前较为简洁

  

  之前的build和config文件夹不见了,那么应该如何配置 如webpack等的配那只需要在项目的根目录下fig.js
文件(是根目录,不是src目录

  语法

   module.exports = { // 基本路径 baseUrl: /, // 输出文件目录 outputDir: dist, // eslint-loader 是否在保存的时候检查 lintOnSave: true, // use the full build with in-browser compiler? // 配置 // see 配置项 // 生产环境是否生成 sourceMap 文件 productionSourceMap: true, // css相关配置 css: { // 是否使用css分离插件 ExtractTextPlugin extract: true, // 开启 CSS source maps? sourceMap: false, // css预设器配置项 loaderOptions: {}, // 启用 CSS modules for all css / pre-processor files. modules: false }, // use thread-loader for babel & TS in production build // enabled by default if the machine has more than 1 cores parallel: require(os).cpus().length > 1, // 是否启用dll // See 插件相关配置 // see 相关配置 devServer: { open: process.platform === darwin, host: 0.0.0.0, port: 8080, https: false, hotOnly: false, proxy: null, // 设置代理 before: app => {} }, // 第三方插件配置 pluginOptions: { // ... } }

  举例

  

  上图内容做了两块内容,经测试没有问题

  1.将启动端口设置为 8080

  2.设置路径别名

  总结

  以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对脚本之家的支持。


评论


亲,登录后才可以留言!