Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vitejs/vite-plugin-vue
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 00ccc856a3a637540e4474701ebd653ff8869f42
Choose a base ref
...
head repository: vitejs/vite-plugin-vue
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ad8796af0f30bb08054cb45908a25290e3ee48fa
Choose a head ref
  • 18 commits
  • 18 files changed
  • 7 contributors

Commits on Dec 9, 2022

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Brooooooklyn LongYinan
    Copy the full SHA
    797e424 View commit details

Commits on Dec 14, 2022

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Brooooooklyn LongYinan
    Copy the full SHA
    f8fb8f6 View commit details

Commits on Dec 21, 2022

  1. Copy the full SHA
    086bb7a View commit details
  2. Copy the full SHA
    61f5ab1 View commit details

Commits on Jan 2, 2023

  1. Copy the full SHA
    8f4a5dc View commit details

Commits on Jan 16, 2023

  1. chore(deps): update dependency unbuild to v1 (#73)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 16, 2023
    Copy the full SHA
    2da4337 View commit details
  2. Copy the full SHA
    26b16ea View commit details

Commits on Jan 25, 2023

  1. Copy the full SHA
    7fec9eb View commit details

Commits on Feb 14, 2023

  1. chore(deps): update dessant/lock-threads action to v4 (#94)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 14, 2023
    Copy the full SHA
    b610640 View commit details
  2. chore(deps): update dependency @vitejs/plugin-legacy to v4 (#99)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 14, 2023
    Copy the full SHA
    ac4b5f7 View commit details
  3. Copy the full SHA
    b303656 View commit details

Commits on Feb 15, 2023

  1. chore(deps): update dependency convert-source-map to v2 (#51)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 15, 2023
    Copy the full SHA
    a78a724 View commit details

Commits on Feb 24, 2023

  1. Copy the full SHA
    c8a61e3 View commit details

Commits on Mar 1, 2023

  1. Copy the full SHA
    aa96ae4 View commit details

Commits on Mar 7, 2023

  1. Copy the full SHA
    40cff6b View commit details

Commits on Mar 13, 2023

  1. fix: avoid resolving to 2.7 compiler-sfc

    This can happen in monorepos where Vue 2.7 is in a package's deps
    while Vue 3 is only a transitive dep, e.g. from VitePress. Even with
    pnpm this can happen because `pnpm run` emulates npm behavior by
    injecting NODE_PATH.
    
    ref: vuejs/vitepress#1507
    yyx990803 committed Mar 13, 2023
    Copy the full SHA
    cf36b3e View commit details
  2. Copy the full SHA
    50e3512 View commit details

Commits on Mar 16, 2023

  1. release: plugin-vue@4.1.0

    patak-dev committed Mar 16, 2023
    Copy the full SHA
    ad8796a View commit details
3 changes: 0 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -13,15 +13,12 @@
],
"ignoreDeps": [
// manually bumping
"esbuild",
"rollup",
"node",
"typescript",

// breaking changes
"source-map", // `source-map:v0.7.0+` needs more investigation
"dotenv-expand", // `dotenv-expand:6.0.0+` has breaking changes (#6858)
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
"miniflare", // `miniflare:v2.0.0+` only supports node 16.7
],
}
2 changes: 1 addition & 1 deletion .github/workflows/lock-closed-issues.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'vitejs/vite-plugin-vue'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
- uses: dessant/lock-threads@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-inactive-days: "14"
2 changes: 1 addition & 1 deletion .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -38,4 +38,4 @@ jobs:
with:
tag_name: ${{ github.ref }}
body: |
Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/${{ github.ref_name }}/packages/${{ steps.tag.outputs.pkgName }}/CHANGELOG.md) for details.
Please refer to [CHANGELOG.md](https://github.com/vitejs/vite-plugin-vue/blob/${{ github.ref_name }}/packages/${{ steps.tag.outputs.pkgName }}/CHANGELOG.md) for details.
65 changes: 19 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
@@ -31,60 +31,45 @@
"ci-publish": "tsx scripts/publishCI.ts"
},
"devDependencies": {
"@babel/types": "^7.20.5",
"@microsoft/api-extractor": "^7.33.6",
"@rollup/plugin-typescript": "^10.0.1",
"@babel/types": "^7.20.7",
"@types/babel__core": "^7.1.20",
"@types/babel__standalone": "^7.1.4",
"@types/convert-source-map": "^1.5.2",
"@types/cross-spawn": "^6.0.2",
"@types/convert-source-map": "^2.0.0",
"@types/debug": "^4.1.7",
"@types/estree": "^1.0.0",
"@types/etag": "^1.8.1",
"@types/fs-extra": "^9.0.13",
"@types/less": "^3.0.3",
"@types/micromatch": "^4.0.2",
"@types/fs-extra": "^11.0.1",
"@types/minimist": "^1.2.2",
"@types/node": "^18.11.10",
"@types/picomatch": "^2.3.0",
"@types/prompts": "^2.4.1",
"@types/node": "^18.11.18",
"@types/prompts": "^2.4.2",
"@types/resolve": "^1.20.2",
"@types/sass": "~1.43.1",
"@types/semver": "^7.3.13",
"@types/stylus": "^0.48.38",
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"conventional-changelog-cli": "^2.2.2",
"esbuild": "^0.16.3",
"eslint": "^8.29.0",
"eslint-define-config": "^1.12.0",
"eslint": "^8.31.0",
"eslint-define-config": "^1.13.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-regexp": "^1.11.0",
"execa": "^6.1.0",
"fast-glob": "^3.2.12",
"fs-extra": "^10.1.0",
"fs-extra": "^11.1.0",
"lint-staged": "^13.1.0",
"minimist": "^1.2.7",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.28.1",
"pnpm": "^7.18.1",
"prettier": "2.8.0",
"playwright-chromium": "^1.29.1",
"pnpm": "^7.21.0",
"prettier": "2.8.1",
"prompts": "^2.4.2",
"resolve": "^1.22.1",
"rimraf": "^3.0.2",
"rollup": "^3.7.0",
"rollup": "^3.17.2",
"rollup-plugin-license": "^2.9.1",
"semver": "^7.3.8",
"simple-git-hooks": "^2.8.1",
"tslib": "^2.4.1",
"tsx": "^3.12.1",
"typescript": "^4.6.4",
"unbuild": "^0.9.4",
"vite": "^4.0.0",
"vitest": "^0.25.3",
"typescript": "^4.9.5",
"unbuild": "^1.1.1",
"vite": "^4.0.3",
"vitest": "^0.26.3",
"vue": "^3.2.45"
},
"simple-git-hooks": {
@@ -105,22 +90,10 @@
"eslint --cache --fix"
]
},
"packageManager": "pnpm@7.18.1",
"packageManager": "pnpm@7.21.0",
"pnpm": {
"overrides": {
"@vitejs/plugin-vue": "workspace:*"
},
"packageExtensions": {
"postcss-load-config": {
"peerDependencies": {
"postcss": "*"
}
},
"acorn-walk": {
"peerDependencies": {
"acorn": "*"
}
}
}
}
}
7 changes: 7 additions & 0 deletions packages/plugin-vue-jsx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.0.0 (2022-12-09)

* chore: update vite dep to ^4.0.0 (#49) ([5a2f789](https://github.com/vitejs/vite-plugin-vue/commit/5a2f789)), closes [#49](https://github.com/vitejs/vite-plugin-vue/issues/49)
* chore(deps): update all non-major dependencies (#40) ([4c95967](https://github.com/vitejs/vite-plugin-vue/commit/4c95967)), closes [#40](https://github.com/vitejs/vite-plugin-vue/issues/40)



## 3.0.0-beta.0 (2022-12-05)

* chore: 3.0 release notes and bump peer deps (#9072) ([e6947e7](https://github.com/vitejs/vite-plugin-vue/commit/e6947e7)), closes [#9072](https://github.com/vitejs/vite-plugin-vue/issues/9072)
8 changes: 4 additions & 4 deletions packages/plugin-vue-jsx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vitejs/plugin-vue-jsx",
"version": "3.0.0-beta.0",
"version": "3.0.0",
"license": "MIT",
"author": "Evan You",
"files": [
@@ -35,12 +35,12 @@
},
"homepage": "https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx#readme",
"dependencies": {
"@babel/core": "^7.20.5",
"@babel/plugin-transform-typescript": "^7.20.2",
"@babel/core": "^7.20.7",
"@babel/plugin-transform-typescript": "^7.20.7",
"@vue/babel-plugin-jsx": "^1.1.1"
},
"devDependencies": {
"vite": "^4.0.0"
"vite": "^4.0.3"
},
"peerDependencies": {
"vite": "^4.0.0",
13 changes: 13 additions & 0 deletions packages/plugin-vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 4.1.0 (2023-03-16)

* fix: avoid resolving to 2.7 compiler-sfc ([cf36b3e](https://github.com/vitejs/vite-plugin-vue/commit/cf36b3e))



## 4.1.0-beta.0 (2023-03-07)

* fix: upgrade rollup and typescript (#114) ([c8a61e3](https://github.com/vitejs/vite-plugin-vue/commit/c8a61e3)), closes [#114](https://github.com/vitejs/vite-plugin-vue/issues/114)
* fix(deps): update all non-major dependencies (#50) ([8f4a5dc](https://github.com/vitejs/vite-plugin-vue/commit/8f4a5dc)), closes [#50](https://github.com/vitejs/vite-plugin-vue/issues/50)



## 4.0.0 (2022-12-09)

* chore: update vite dep to ^4.0.0 (#49) ([5a2f789](https://github.com/vitejs/vite-plugin-vue/commit/5a2f789)), closes [#49](https://github.com/vitejs/vite-plugin-vue/issues/49)
6 changes: 3 additions & 3 deletions packages/plugin-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vitejs/plugin-vue",
"version": "4.0.0",
"version": "4.1.0",
"license": "MIT",
"author": "Evan You",
"files": [
@@ -42,10 +42,10 @@
"@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17",
"debug": "^4.3.4",
"rollup": "^3.7.0",
"rollup": "^3.17.2",
"slash": "^5.0.0",
"source-map": "^0.6.1",
"vite": "^4.0.0",
"vite": "^4.0.3",
"vue": "^3.2.45"
}
}
12 changes: 9 additions & 3 deletions packages/plugin-vue/src/compiler.ts
Original file line number Diff line number Diff line change
@@ -10,9 +10,7 @@ import type * as _compiler from 'vue/compiler-sfc'

export function resolveCompiler(root: string): typeof _compiler {
// resolve from project root first, then fallback to peer dep (if any)
const compiler =
tryRequire('vue/compiler-sfc', root) || tryRequire('vue/compiler-sfc')

const compiler = tryResolveCompiler(root) || tryResolveCompiler()
if (!compiler) {
throw new Error(
`Failed to resolve vue/compiler-sfc.\n` +
@@ -24,6 +22,14 @@ export function resolveCompiler(root: string): typeof _compiler {
return compiler
}

function tryResolveCompiler(root?: string) {
const vueMeta = tryRequire('vue/package.json', root)
// make sure to check the version is 3+ since 2.7 now also has vue/compiler-sfc
if (vueMeta && vueMeta.version.split('.')[0] >= 3) {
return tryRequire('vue/compiler-sfc', root)
}
}

const _require = createRequire(import.meta.url)
function tryRequire(id: string, from?: string) {
try {
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"private": true,
"version": "1.0.0",
"devDependencies": {
"convert-source-map": "^1.9.0",
"convert-source-map": "^2.0.0",
"css-color-names": "^1.0.1",
"kill-port": "^1.6.1",
"node-fetch": "^3.3.0",
1 change: 0 additions & 1 deletion playground/ssr-vue/__tests__/ssr-vue.spec.ts
Original file line number Diff line number Diff line change
@@ -241,7 +241,6 @@ test.runIf(!isBuild)(
expect(spy).toBeCalledTimes(1)
const [firstParameter] = spy.mock.calls[0]
expect(firstParameter).toContain('Error when evaluating SSR module')
expect(firstParameter).toContain(THROW_MESSAGE)
spy.mockClear()
},
)
2 changes: 1 addition & 1 deletion playground/ssr-vue/package.json
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
},
"dependencies": {
"@vitejs/test-example-external-component": "file:example-external-component",
"pinia": "^2.0.27",
"pinia": "^2.0.28",
"vue": "^3.2.45",
"vue-router": "^4.1.6"
},
2 changes: 1 addition & 1 deletion playground/vue-legacy/package.json
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "workspace:*",
"@vitejs/plugin-legacy": "^3.0.0-alpha.0"
"@vitejs/plugin-legacy": "^4.0.1"
}
}
12 changes: 8 additions & 4 deletions playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts
Original file line number Diff line number Diff line change
@@ -21,14 +21,16 @@ describe.runIf(isServe)('serve:vue-sourcemap', () => {
throw new Error('Style not found: ' + content)
}

test('js', async () => {
// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('js', async () => {
const res = await page.request.get(new URL('./Js.vue', page.url()).href)
const js = await res.text()
const map = extractSourcemap(js)
expect(formatSourcemapForSnapshot(map)).toMatchSnapshot('serve-js')
})

test('ts', async () => {
// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('ts', async () => {
const res = await page.request.get(new URL('./Ts.vue', page.url()).href)
const js = await res.text()
const map = extractSourcemap(js)
@@ -91,7 +93,8 @@ describe.runIf(isServe)('serve:vue-sourcemap', () => {
)
})

test('no script', async () => {
// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('no script', async () => {
const res = await page.request.get(
new URL('./NoScript.vue', page.url()).href,
)
@@ -100,7 +103,8 @@ describe.runIf(isServe)('serve:vue-sourcemap', () => {
expect(formatSourcemapForSnapshot(map)).toMatchSnapshot('serve-no-script')
})

test('no template', async () => {
// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('no template', async () => {
const res = await page.request.get(
new URL('./NoTemplate.vue', page.url()).href,
)
4 changes: 2 additions & 2 deletions playground/vue-sourcemap/package.json
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
"devDependencies": {
"@vitejs/plugin-vue": "workspace:*",
"less": "^4.1.3",
"postcss-nested": "^5.0.6",
"sass": "^1.56.1"
"postcss-nested": "^6.0.0",
"sass": "^1.57.1"
},
"dependencies": {
"vue": "^3.2.45"
2 changes: 1 addition & 1 deletion playground/vue/__tests__/vue.spec.ts
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ describe('asset reference', () => {
})

test('absolute import', async () => {
const el = await page.$('img.relative-import')
const el = await page.$('img.absolute-import')
expect(await el.evaluate((el) => (el as HTMLImageElement).src)).toMatch(
assetMatch,
)
2 changes: 1 addition & 1 deletion playground/vue/package.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
"js-yaml": "^4.1.0",
"less": "^4.1.3",
"pug": "^3.0.2",
"sass": "^1.56.1",
"sass": "^1.57.1",
"stylus": "^0.59.0"
}
}
Loading