Commit eea349b2 by Jaxon

build(config): 调整构建配置与依赖,更新开发环境publicPath

- 修改vue.config.js的开发环境publicPath为/dj-scrm-wx-work-main-jaxon/
- 重构.postcssrc.js配置,移除调试日志并优化代码格式
- 升级autoprefixer至9.8.8,清理过时的autoprefixer@8、postcss-loader和postcss-pxtorem依赖
1 parent d23f7026
// // https://github.com/michael-ciniawsky/postcss-load-config
module.exports = ({file}) => {
console.log(file)
// const Adaptive = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|WebOS|Symbian|Windows Phone)/i,
// isMobile = (Adaptive.exec(avigator.userAgent))
return {
plugins: {
autoprefixer: {
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
},
'postcss-px-to-viewport': {
viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
selectorBlackList: ['.ignore', '.hairlines', 'ign-', 'pc-'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false, // 允许在媒体查询中转换`px`
module.exports = () => {
return {
plugins: {
// Keep CSS prefix targets local to PostCSS for now; changing the global
// browserslist would also affect Babel transpilation targets.
"autoprefixer": {
overrideBrowserslist: ["Android 4.1", "iOS 7.1", "Chrome > 31", "ff > 31", "ie >= 8"],
},
"postcss-px-to-viewport": {
viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit: "vw", // 指定需要转换成的视窗单位,建议使用vw
selectorBlackList: [".ignore", ".hairlines", "ign-", "pc-"], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false, // 允许在媒体查询中转换`px`
exclude: [/node_modules/]
}
}
}
}
exclude: [/node_modules/],
},
},
};
};
......@@ -12,12 +12,10 @@
"dev": "npm run serve"
},
"dependencies": {
"autoprefixer": "^8.0.0",
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2",
"postcss-loader": "^4.3.0",
"sha1": "^1.1.1",
"storejs": "^1.1.0",
"vant": "^2.12.21",
......@@ -33,13 +31,13 @@
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"autoprefixer": "^9.8.8",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^9.39.2",
"eslint-plugin-format": "^1.2.0",
"postcss-px-to-viewport": "^1.1.1",
"postcss-pxtorem": "^5.1.1",
"sass": "^1.99.0",
"sass-loader": "^8.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
......
......@@ -27,7 +27,7 @@ function spritesmithFunction(data) {
}
module.exports = {
// 署应用包时的基本 URL。 vue-router hash 模式使用
publicPath: IS_PROD ? "./" : "/dj-scrm-wx-work-main-cwq/",
publicPath: IS_PROD ? "./" : "/dj-scrm-wx-work-main-jaxon/",
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!