From 37ca4e0817ec35ef9f56c2fd732157a8aeb71a6a Mon Sep 17 00:00:00 2001 From: Fritz Lin Date: Tue, 9 Aug 2022 20:56:31 +0800 Subject: [PATCH] wip: switched to vite. todo: vite should support css.extract=false https://github.com/fritx/vue-at/issues/137 https://github.com/vitejs/vite/issues/4345 https://github.com/vitejs/vite/issues/9086 --- README.md | 4 +++- index.html | 9 +++++---- package.json | 28 ++++++++++++---------------- public/vite.svg | 1 + src/App.vue | 11 +++++++++-- vite.config.0.js | 27 +++++++++++++++++++++++++++ vite.config.1.js | 16 ++++++++++++++++ vite.config.2.js | 16 ++++++++++++++++ vite.demo.config.js | 12 ++++++++++++ vue.config.js | 27 --------------------------- 10 files changed, 101 insertions(+), 50 deletions(-) create mode 100644 public/vite.svg create mode 100644 vite.config.0.js create mode 100644 vite.config.1.js create mode 100644 vite.config.2.js create mode 100644 vite.demo.config.js delete mode 100644 vue.config.js diff --git a/README.md b/README.md index 0d78b5c..e98964e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ npm i vue1-at # for Vue1 (branch vue1-new) + diff --git a/package.json b/package.json index 9e961bf..a0ad5ea 100644 --- a/package.json +++ b/package.json @@ -5,16 +5,15 @@ "author": "Fritz Lin ", "repository": "https://github.com/fritx/vue-at", "scripts": { - "lint:fix": "vue-cli-service lint", - "lint": "vue-cli-service lint --no-fix", - "dev:dist": "vue-cli-service serve --skip-plugins eslint", - "dev": "vue-cli-service serve", - "build:at": "vue-cli-service build ./src/At.vue --target lib --name vue-at", - "build:at-ta": "vue-cli-service build ./src/AtTextarea.vue --target lib --name vue-at-textarea", - "build": "rimraf dist && run-p build:at build:at-ta && rimraf dist/demo.html", + "lint:fix": "eslint --ext .js,.vue --ignore-path .gitignore --fix src", + "lint": "eslint --ext .js,.vue --ignore-path .gitignore src", + "dev": "vite --config vite.demo.config.js", + "build": "rimraf dist && run-s build:at build:at-ta", + "build:at": "vite build --config vite.config.1.js", + "build:at-ta": "vite build --config vite.config.2.js", "prepublish": "npm run build" }, - "main": "dist/vue-at.common.js", + "main": "dist/vue-at", "engines": { "node": ">= 14.x" }, @@ -25,11 +24,9 @@ "vue": "3.x" }, "devDependencies": { - "@babel/core": "^7.18.9", - "@vue/cli-plugin-eslint": "^5.0.8", - "@vue/cli-service": "^5.0.8", + "@vitejs/plugin-legacy": "^2.0.0", + "@vitejs/plugin-vue": "^3.0.1", "@vue/compat": "^3.1.0", - "@vue/compiler-sfc": "^3.1.0", "@vue/eslint-config-standard": "^8.0.1", "element-plus": "^2.2.12", "eslint": "^8.21.0", @@ -37,9 +34,8 @@ "npm-run-all": "^4.1.5", "rimraf": "^3.0.2", "sass": "^1.53.0", - "sass-loader": "^13.0.2", - "vue": "^3.1.0", - "vue-loader": "^16.0.0", - "webpack": "^5.73.0" + "terser": "^5.4.0", + "vite": "^3.0.5", + "vue": "^3.1.0" } } diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index b67a613..2e9a761 100644 --- a/src/App.vue +++ b/src/App.vue @@ -79,11 +79,18 @@