-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: switched to vite. todo: vite should support css.extract=false
- Loading branch information
Showing
10 changed files
with
91 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>vue-at</title> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Demo: vue-at</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="dist/demo.js"></script> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,19 @@ | |
"author": "Fritz Lin <[email protected]>", | ||
"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", | ||
"demo": "vue-cli-service build", | ||
"build:at": "vue-cli-service build ./src/At.vue --target lib --name vue-at && shx mv dist/vue-at.common.js dist/vue-at.js", | ||
"build:at-ta": "vue-cli-service build ./src/AtTextarea.vue --target lib --name vue-at-textarea && shx mv dist/vue-at-textarea.common.js dist/vue-at-textarea.js", | ||
"build": "shx rm -rf dist && run-p build:at build:at-ta && shx rm 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", | ||
"demo": "vite build --config vite.demo.config.js", | ||
"build": "shx rm -rf 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.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"main": "dist/vue-at", | ||
"engines": { | ||
"node": ">= 14.x" | ||
}, | ||
|
@@ -29,21 +28,16 @@ | |
"vue": "3.x" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.18.9", | ||
"@vue/cli-plugin-eslint": "^5.0.8", | ||
"@vue/cli-service": "^5.0.8", | ||
"@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", | ||
"eslint-plugin-vue": "^9.3.0", | ||
"npm-run-all": "^4.1.5", | ||
"sass": "^1.53.0", | ||
"sass-loader": "^13.0.2", | ||
"shx": "^0.3.4", | ||
"vue": "^3.1.0", | ||
"vue-loader": "^16.0.0", | ||
"webpack": "^5.73.0" | ||
"vite": "^3.0.5", | ||
"vue": "^3.1.0" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// https://vueschool.io/articles/vuejs-tutorials/how-to-migrate-from-vue-cli-to-vite/ | ||
// vue2 | ||
// import { createVuePlugin as vue } from 'vite-plugin-vue2' | ||
// vue3 | ||
import vue from '@vitejs/plugin-vue' | ||
|
||
// todo: vite should support css.extract=false | ||
// pending https://github.com/vitejs/vite/issues/4345 | ||
|
||
export default { | ||
plugins: [vue()], | ||
build: { | ||
emptyOutDir: false, | ||
rollupOptions: { | ||
// make sure to externalize deps that shouldn't be bundled | ||
// into your library | ||
external: ['vue'], | ||
output: { | ||
// Provide global variables to use in the UMD build | ||
// for externalized deps | ||
globals: { | ||
vue: 'Vue' | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { defineConfig } from 'vite' | ||
import { resolve } from 'path' | ||
import commonConfig from './vite.config.0' | ||
|
||
export default defineConfig({ | ||
...commonConfig, | ||
build: { | ||
...commonConfig.build, | ||
lib: { | ||
entry: resolve(__dirname, 'src/At.vue'), | ||
name: 'VueAt', | ||
fileName: 'vue-at', | ||
formats: ['cjs', 'umd'] | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { defineConfig } from 'vite' | ||
import { resolve } from 'path' | ||
import commonConfig from './vite.config.0' | ||
|
||
export default defineConfig({ | ||
...commonConfig, | ||
build: { | ||
...commonConfig.build, | ||
lib: { | ||
entry: resolve(__dirname, 'src/AtTextarea.vue'), | ||
name: 'VueAtTextarea', | ||
fileName: 'vue-at-textarea', | ||
formats: ['cjs', 'umd'] | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { defineConfig } from 'vite' | ||
|
||
// https://vueschool.io/articles/vuejs-tutorials/how-to-migrate-from-vue-cli-to-vite/ | ||
// vue2 | ||
// import { createVuePlugin as vue } from 'vite-plugin-vue2' | ||
// vue3 | ||
import vue from '@vitejs/plugin-vue' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [vue()] | ||
}) |
This file was deleted.
Oops, something went wrong.