Browse Source

style: tiny update & remove autoprefixer

菲鸽 2 years ago
parent
commit
da3b31c446
3 changed files with 11 additions and 10 deletions
  1. 5 4
      shell/postinstall.js
  2. 1 1
      shell/postinstall.sh
  3. 5 5
      vite.config.ts

+ 5 - 4
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}已经成功创建,并写入{}`)
   })
 }

+ 1 - 1
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

+ 5 - 5
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'],
+          // }),
         ],
       },
     },