From da3b31c446241ae780d8b13f4f0c13acd94dda63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com> Date: Wed, 31 Jan 2024 18:50:58 +0800 Subject: [PATCH] style: tiny update & remove autoprefixer --- shell/postinstall.js | 9 +++++---- shell/postinstall.sh | 2 +- vite.config.ts | 10 +++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/shell/postinstall.js b/shell/postinstall.js index a32d04c..246ef49 100644 --- a/shell/postinstall.js +++ b/shell/postinstall.js @@ -2,19 +2,20 @@ * 本文件会在依赖包安装时执行,用以生成 `src/manifest.json` * 如果不存在 `src/manifest.json` 会运行报错,提示找不到 `src/manifest.json` * 如果中途自己删除了 'src/manifest.json' 文件,记得手动执行本文件,可以右键 `Run Code` 快速执行 + * + * 本文件是为了兼容 window 系统才生成的 */ // eslint-disable-next-line @typescript-eslint/no-var-requires const fs = require('fs') const filePath = './src/manifest.json' -console.log(filePath) if (fs.existsSync(filePath)) { - console.log(`${filePath}存在`) + // console.log(`${filePath}存在`) } else { - console.log(`${filePath}不存在,需要创建`) + // console.log(`${filePath}不存在,需要创建`) fs.writeFile(filePath, '{}\n', {}, () => { - console.log(`${filePath}已经成功创建,并写入{}`) + // console.log(`${filePath}已经成功创建,并写入{}`) }) } diff --git a/shell/postinstall.sh b/shell/postinstall.sh index be33812..24b25a7 100644 --- a/shell/postinstall.sh +++ b/shell/postinstall.sh @@ -3,7 +3,7 @@ # 如果中途自己删除了 'src/manifest.json' 文件,记得手动执行本文件,可以右键 `Run Code` 快速执行 if test -f ./src/manifest.json; then - echo ./src/manifest.json 存在 + # echo ./src/manifest.json 存在 else touch ./src/manifest.json echo "{}" >./src/manifest.json diff --git a/vite.config.ts b/vite.config.ts index cadfe3f..9dc3e67 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,7 +13,7 @@ import UniPlatform from '@uni-helper/vite-plugin-uni-platform' import UniManifest from '@uni-helper/vite-plugin-uni-manifest' // @see https://unocss.dev/ import UnoCSS from 'unocss/vite' -import autoprefixer from 'autoprefixer' +// import autoprefixer from 'autoprefixer' // @see https://github.com/jpkleemans/vite-svg-loader import svgLoader from 'vite-svg-loader' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' @@ -136,10 +136,10 @@ export default ({ command, mode }) => { css: { postcss: { plugins: [ - autoprefixer({ - // 指定目标浏览器 - overrideBrowserslist: ['> 1%', 'last 2 versions'], - }), + // autoprefixer({ + // // 指定目标浏览器 + // overrideBrowserslist: ['> 1%', 'last 2 versions'], + // }), ], }, },