vue3.0 没有 vue.condig.js 解决
2023-09-14 09:06:39 时间
第一次用 vue3.0 ,发现没有vue.config.js ,只有一个babel.config.js
怎么办?
需要在根目录手动添加一个即可,如下
相关的配置说明
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
module.exports = { devServer: { open: true, // 自动打开浏览器 hot: true, // 实时打包编译 host: '0.0.0.0', inline: true, // 表示实时刷新浏览器 port: '8020' // 指定打开浏览器的端口号 } } // module.exports = { // /** 区分打包环境与开发环境 // * process.env.NODE_ENV==='production' (打包环境) // * process.env.NODE_ENV==='development' (开发环境) // * baseUrl: process.env.NODE_ENV==='production'?"https://cdn.didabisai.com/front/":'front/', // */ // // 项目部署的基础路径 // // 我们默认假设你的应用将会部署在域名的根部, // // 例如 https://www.my-app.com/ // // 如果你的应用部署在一个子路径下,那么你需要在这里 // // 指定子路径。比如将你的应用部署在 // // https://www.foobar.com/my-app/ // // 那么将这个值改为 '/my-app/' // baseUrl: "/", // 构建好的文件输出到哪里 // // outputDir: "dist", // where to put static assets (js/css/img/font/...) // 是否在保存时使用‘eslint-loader’进行检查 // 有效值: true | false | 'error' // 当设置为‘error’时,检查出的错误会触发编译失败 // lintOnSave: true, // 使用带有浏览器内编译器的完整构建版本 // https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only // runtimeCompiler: false, // babel-loader默认会跳过`node_modules`依赖. // 通过这个选项可以显示转译一个依赖 // transpileDependencies: [ // /* string or regex */ // ], // 是否为生产环境构建生成sourceMap? // // productionSourceMap: false, // 调整内部的webpack配置. // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md // chainWebpack: () => {}, // configureWebpack: () => {}, // CSS 相关选项 // css: { // // 将组件内部的css提取到一个单独的css文件(只用在生产环境) // // 也可以是传递给 extract-text-webpack-plugin 的选项对象 // extract: true, // 允许生成 CSS source maps? // sourceMap: false, // pass custom options to pre-processor loaders. e.g. to pass options to // sass-loader, use { sass: { ... } } // loaderOptions: {}, // Enable CSS modules for all css / pre-processor files. // This option does not affect *.vue 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, // PWA 插件相关配置 // see https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa // // pwa: {}, // configure webpack-dev-server behavior // devServer: { // open: process.platform === "darwin", // disableHostCheck: false, // host: "0.0.0.0", // port: 8088, // https: false, // hotOnly: false, // See https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md#configuring-proxy // proxy: null // string | Object // // before: app => {} // }, // 第三方插件配置 // // pluginOptions: { // // ... // } // };
相关文章
- Vue.js 渲染简写样式存在的问题
- Vue.js快速介绍-超级马里奥像素艺术
- 使用 Vuex + Vue.js 构建单页应用【新篇】
- 手把手教你学vue-4(vuex)
- VUE - vue.runtime.esm.js?6e6d:619 [Vue warn]: Do not use built-in or reserved HTML elements as component i
- vue-cli3组件嵌套
- vue项目中抽离.vue文件中的js代码
- vue.js - 解决vue-cli打包后自动压缩代码
- vue.js语法
- vue-cli的webpack模板项目配置文件分析
- [Vue @Component] Dynamic Vue.js Components with the component element
- [Vue-rx] Disable Buttons While Data is Loading with RxJS and Vue.js
- [Vue] Use Vue.js Watchers to Respond to Async Updates
- [Vue] Preload Data using Promises with Vue.js and Nuxt.js
- vue.js3:用exif-js读取图片的exif信息(vue@3.2.36)
- vue.js 3.2.22:平滑回到顶部
- @vue/cli 4.5.13:创建一个vue.js3.x项目(vue.js 3.2.4)
- vue表单校验必填项
- [Vue] Props Validations
- [Vue-rx] Access Events from Vue.js Templates as RxJS Streams with domStreams
- vue.js3:使用clipboard.js实现复制到剪贴板(vue@3.2.37 / clipboard@2.0.11)
- vue.js3.2.20: 使用svg(svg-sprite-loader@6.0.9)
- typora及vue主题安装
- Atitit vue.js 把ajax数据 绑定到form表单
- Vue 记录 TypeError: Cannot read properties of undefined (reading ‘_withTask‘)
- events.js:292 throw er; // Unhandled ‘error‘ event,vue项目打包失败
- vue 日期时间过滤器
- 计算机毕设 SSM Vue的留学生交流互动管理系统(含源码+论文)
- Vue学习之--------路由守卫(2022/9/6)
- vue.js中引入图片
- 203:vue+openlayers 地图旋转移动动画、CSS缩放动画,介绍animate的使用方法
- 028:vue+openlayers使用geojson数据加载热力图(示例代码)
- 066:vue+openlayers画各种图形并获取feature信息( 示例代码 )
- Vue学习笔记——vuex