From 30057420df3678025957907d053a0dc90561cf9f Mon Sep 17 00:00:00 2001 From: dengtongyu Date: Mon, 28 Dec 2020 11:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue.config.js | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/vue.config.js b/vue.config.js index 420ab2b..9b277e7 100644 --- a/vue.config.js +++ b/vue.config.js @@ -4,47 +4,47 @@ const pxtoviewport = require("postcss-px-to-viewport"); const pxtowritesvg = require("postcss-write-svg"); module.exports = { - publicPath: "./", - outputDir: "dist", - assetsDir: "static", - indexPath: "index.html", - pages: { - index: { - // page 的入口 - entry: "src/main.js", - // 模板来源 - template: "public/index.html", - // 在 dist/index.html 的输出 - filename: "index.html", - // 当使用 title 选项时, - // template 中的 title 标签需要是 <%= htmlWebpackPlugin.options.title %> - title: config.systemName, - // 在这个页面中包含的块,默认情况下会包含 - // 提取出来的通用 chunk 和 vendor chunk。 - chunks: ["chunk-vendors", "chunk-common", "index"] + publicPath: "./", + outputDir: "dist", + assetsDir: "static", + indexPath: "index.html", + pages: { + index: { + // page 的入口 + entry: "src/main.js", + // 模板来源 + template: "public/index.html", + // 在 dist/index.html 的输出 + filename: "index.html", + // 当使用 title 选项时, + // template 中的 title 标签需要是 <%= htmlWebpackPlugin.options.title %> + title: config.appName, + // 在这个页面中包含的块,默认情况下会包含 + // 提取出来的通用 chunk 和 vendor chunk。 + chunks: ["chunk-vendors", "chunk-common", "index"] + } + }, + devServer: { + proxy: proxy + }, + css: { + loaderOptions: { + postcss: { + plugins: [ + pxtowritesvg({ + utf8: false + }), + pxtoviewport({ + viewportWidth: 750, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750 + viewportHeight: 1334, // 视窗的高度,根据750设备的宽度来指定,一般指定1334,也可以不配置 + unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除) + viewportUnit: "vw", // 指定需要转换成的视窗单位,建议使用vw + selectorBlackList: [".ignore", ".hairlines"], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名 + minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值 + mediaQuery: false // 允许在媒体查询中转换`px` + }) + ] + } + } } - }, - devServer: { - proxy: proxy - }, - css: { - loaderOptions: { - postcss: { - plugins: [ - pxtowritesvg({ - utf8: false - }), - pxtoviewport({ - viewportWidth: 750, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750 - viewportHeight: 1334, // 视窗的高度,根据750设备的宽度来指定,一般指定1334,也可以不配置 - unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除) - viewportUnit: "vw", // 指定需要转换成的视窗单位,建议使用vw - selectorBlackList: [".ignore", ".hairlines"], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名 - minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值 - mediaQuery: false // 允许在媒体查询中转换`px` - }) - ] - } - } - } -}; +}; \ No newline at end of file