| 1234567891011121314151617181920212223242526272829303132333435 |
- const { defineConfig } = require('@vue/cli-service')
- module.exports = defineConfig({
- transpileDependencies: true,
- devServer: {
- open: true, // 自动打开
- host: 'localhost',
- proxy: { // 配置代理
- '/api': {
- target: 'http://cc-api.localhost.cc/',
- changeOrigin: true, //允许跨域
- pathRewrite: {
- '^/api': 'api'
- }
- }
- }
- },
- css: {
- loaderOptions: {
- postcss: {
- postcssOptions: {
- plugins: [
- // 自动添加浏览器前缀
- require('autoprefixer'),
- // 单位转换插件
- require('postcss-pxtorem')({
- rootValue: 37.5, // 根据设计稿调整(设计稿宽度/10)
- propList: ['*'], // 转换所有属性
- exclude: /node_modules/ // 排除 node_modules 目录
- })
- ]
- }
- }
- }
- }
- })
|