最新代码
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
const { defineConfig } = require("@vue/cli-service");
|
||||
const postcssPxToViewport = require("postcss-px-to-viewport");
|
||||
const {defineConfig} = require('@vue/cli-service')
|
||||
const postcssPxToViewport = require('postcss-px-to-viewport')
|
||||
const path = require('path') // 需要引入 path 模块
|
||||
|
||||
module.exports = defineConfig({
|
||||
publicPath: "./",
|
||||
publicPath: './',
|
||||
transpileDependencies: false,
|
||||
lintOnSave: false,
|
||||
devServer: {
|
||||
@ -12,7 +13,12 @@ module.exports = defineConfig({
|
||||
},
|
||||
configureWebpack: (config) => {
|
||||
//调试JS
|
||||
config.devtool = "source-map";
|
||||
config.devtool = 'source-map'
|
||||
config.resolve = {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
}
|
||||
},
|
||||
css: {
|
||||
loaderOptions: {
|
||||
@ -21,13 +27,13 @@ module.exports = defineConfig({
|
||||
// 增加这一层 postcssOptions
|
||||
plugins: [
|
||||
postcssPxToViewport({
|
||||
unitToConvert: "px",
|
||||
unitToConvert: 'px',
|
||||
viewportWidth: 1920,
|
||||
unitPrecision: 6,
|
||||
viewportUnit: "vw",
|
||||
fontViewportUnit: "vw",
|
||||
propList: ["*"],
|
||||
selectorBlackList: ["ignore-"],
|
||||
viewportUnit: 'vw',
|
||||
fontViewportUnit: 'vw',
|
||||
propList: ['*'],
|
||||
selectorBlackList: ['ignore-'],
|
||||
minPixelValue: 1,
|
||||
mediaQuery: false,
|
||||
replace: true,
|
||||
@ -40,4 +46,4 @@ module.exports = defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user