diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6260aa32..05813fbd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -42,6 +42,10 @@ jobs:
# node_version: 18
fail-fast: false
+ env:
+ # Install playwright's binray under node_modules so it will be cached together
+ PLAYWRIGHT_BROWSERS_PATH: "0"
+
name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
steps:
- name: Checkout
@@ -59,6 +63,9 @@ jobs:
- name: Install deps
run: pnpm install
+ - name: Install Playwright
+ run: pnpm playwright install
+
- name: Build vite
run: pnpm run ci-build-vite
@@ -97,6 +104,8 @@ jobs:
- name: Install deps
run: pnpm install
+ env:
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
- name: Prepare
run: |
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 72a6ffde..022a0cbc 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -31,6 +31,8 @@ jobs:
- name: Install deps
run: pnpm install
+ env:
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
- name: Publish package
run: pnpm run ci-publish -- ${{ github.ref_name }}
diff --git a/.npmrc b/.npmrc
index 4abbb42e..0a8182ea 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,6 +1,5 @@
hoist-pattern[]=*eslint*
hoist-pattern[]=*babel*
-hoist-pattern[]=*jest*
hoist-pattern[]=@emotion/*
hoist-pattern[]=postcss
hoist-pattern[]=pug
diff --git a/package.json b/package.json
index ef29b398..6a8dca7f 100644
--- a/package.json
+++ b/package.json
@@ -38,10 +38,23 @@
"devDependencies": {
"@microsoft/api-extractor": "^7.23.1",
"@types/babel__core": "^7.1.19",
+ "@types/convert-source-map": "^1.5.2",
+ "@types/cross-spawn": "^6.0.2",
+ "@types/debug": "^4.1.7",
+ "@types/estree": "^0.0.51",
+ "@types/etag": "^1.8.1",
"@types/fs-extra": "^9.0.13",
+ "@types/hash-sum": "^1.0.0",
+ "@types/less": "^3.0.3",
+ "@types/micromatch": "^4.0.2",
+ "@types/mime": "^2.0.3",
"@types/node": "^17.0.31",
"@types/prompts": "^2.4.0",
+ "@types/resolve": "^1.20.2",
+ "@types/sass": "~1.43.1",
"@types/semver": "^7.3.9",
+ "@types/stylus": "^0.48.37",
+ "@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"conventional-changelog-cli": "^2.2.2",
@@ -71,7 +84,8 @@
"typescript": "^4.6.4",
"vite": "workspace:*",
"vitepress": "^0.22.4",
- "vitest": "^0.12.4"
+ "vitest": "^0.12.4",
+ "vue": "^3.2.33"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false",
@@ -91,7 +105,7 @@
"eslint --fix"
]
},
- "packageManager": "pnpm@6.32.11",
+ "packageManager": "pnpm@7.0.1",
"pnpm": {
"overrides": {
"vite": "workspace:*",
diff --git a/packages/plugin-vue/package.json b/packages/plugin-vue/package.json
index 9124f4f9..5ee997fe 100644
--- a/packages/plugin-vue/package.json
+++ b/packages/plugin-vue/package.json
@@ -36,7 +36,6 @@
},
"devDependencies": {
"@rollup/pluginutils": "^4.2.1",
- "@types/hash-sum": "^1.0.0",
"debug": "^4.3.4",
"hash-sum": "^2.0.0",
"rollup": "^2.72.1",
diff --git a/playground/ssr-vue/__tests__/serve.ts b/playground/ssr-vue/__tests__/serve.ts
index efa2b3fb..ae9accd4 100644
--- a/playground/ssr-vue/__tests__/serve.ts
+++ b/playground/ssr-vue/__tests__/serve.ts
@@ -14,7 +14,7 @@ export async function serve(root, isProd) {
// client build
await build({
root,
- logLevel: 'silent', // exceptions are logged by Jest
+ logLevel: 'silent', // exceptions are logged by Vitest
build: {
target: 'esnext',
minify: false,
diff --git a/playground/ssr-vue/src/App.vue b/playground/ssr-vue/src/App.vue
index dc8bfca1..d824089e 100644
--- a/playground/ssr-vue/src/App.vue
+++ b/playground/ssr-vue/src/App.vue
@@ -4,7 +4,9 @@
About
-
+
+
+
diff --git a/playground/ssr-vue/src/pages/About.vue b/playground/ssr-vue/src/pages/About.vue
index 2c8589f7..ea651080 100644
--- a/playground/ssr-vue/src/pages/About.vue
+++ b/playground/ssr-vue/src/pages/About.vue
@@ -11,7 +11,7 @@ export default {
async setup() {
const url = import.meta.env.SSR
? import.meta.url
- : document.querySelector('.import-meta-url').textContent
+ : document.querySelector('.import-meta-url')?.textContent
return {
msg: 'About',
url
diff --git a/playground/ssr-vue/src/pages/Home.vue b/playground/ssr-vue/src/pages/Home.vue
index 32a33882..7f595e74 100644
--- a/playground/ssr-vue/src/pages/Home.vue
+++ b/playground/ssr-vue/src/pages/Home.vue
@@ -33,8 +33,8 @@ function load(file) {
}
const url = import.meta.env.SSR
? import.meta.url
- : document.querySelector('.import-meta-url').textContent
-const protocol = new URL(url).protocol
+ : document.querySelector('.import-meta-url')?.textContent
+const protocol = url ? new URL(url).protocol : undefined
const state = reactive({
count: 0,
diff --git a/playground/vitestSetup.ts b/playground/vitestSetup.ts
index c70c37fe..4734f561 100644
--- a/playground/vitestSetup.ts
+++ b/playground/vitestSetup.ts
@@ -184,7 +184,6 @@ beforeAll(async (s) => {
// If the page remains open, a command like `await page.click(...)` produces
// a timeout with an exception that hides the real error in the console.
await page.close()
-
beforeAllError = e
}