Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
TODOs.md
temp
.DS_Store
.idea
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v20
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

---

> Note: this plugin only works with Vue@^2.7.0.
> Note: this plugin requires Vite@^8.0.0 and only works with Vue@^2.7.0. Please check out older releases for Vite 7 downward support.

```js
// vite.config.js
Expand Down Expand Up @@ -103,6 +103,7 @@ export default {

```ts
import vue from '@vitejs/plugin-vue2'
import yaml from 'js-yaml'

const vueI18nPlugin = {
name: 'vue-i18n',
Expand All @@ -111,7 +112,7 @@ const vueI18nPlugin = {
return
}
if (/\.ya?ml$/.test(id)) {
code = JSON.stringify(require('js-yaml').load(code.trim()))
code = JSON.stringify(yaml.load(code.trim()))
}
return `export default Comp => {
Comp.i18n = ${code}
Expand Down
5 changes: 4 additions & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export default defineBuildConfig({
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true
inlineDependencies: true,
output: {
exports: 'named'
}
}
})
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
},
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && esno scripts/patchCJS.ts",
"build": "unbuild && tsx scripts/patchCJS.ts",
"test": "vitest run",
"release": "node scripts/release.js",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"engines": {
"node": "^14.18.0 || >= 16.0.0"
"node": "^20.19.0 || >=22.12.0"
},
"repository": {
"type": "git",
Expand All @@ -37,7 +37,7 @@
},
"homepage": "https://github.com/vitejs/vite-plugin-vue2/#readme",
"peerDependencies": {
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0",
"vite": "^8.0.0",
"vue": "^2.7.0-0"
},
"devDependencies": {
Expand All @@ -57,8 +57,10 @@
"semver": "^7.3.7",
"slash": "^3.0.0",
"source-map": "^0.6.1",
"unbuild": "^0.7.4",
"vite": "^3.0.0",
"tsx": "^4.21.0",
"typescript": "^6.0.2",
"unbuild": "^3.6.1",
"vite": "^8.0.8",
"vitest": "^0.15.1",
"vue": "^2.7.0-beta.8"
}
Expand Down
Loading