Skip to content

Commit 1901b42

Browse files
authored
fix: replace relative-require with our own resolveDependencyData (#254)
* fix: replace relative-require with our own resolveDependencyData to avoid errors when package.json isn't exported * feat: implement simple cache for resolved svelte fields * ci: use windows-2019 label to see if windows fail is caused by new github default * ci: remove esbuild install calls, relax timeouts for ci and windows, add logging to globalSetup * chore: add changeset
1 parent a31f6c6 commit 1901b42

File tree

28 files changed

+239
-192
lines changed

28 files changed

+239
-192
lines changed

.changeset/five-houses-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/vite-plugin-svelte': patch
3+
---
4+
5+
do not use require-relative to resolve svelte field of libraries and cache resolved values (fixes #244)

.github/workflows/ci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ jobs:
3434
cache: 'pnpm'
3535
cache-dependency-path: '**/pnpm-lock.yaml'
3636
- name: install
37-
run: |
38-
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
39-
node node_modules/esbuild/install.js
37+
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
4038
- name: build
4139
id: build
4240
run: pnpm run build
@@ -58,7 +56,7 @@ jobs:
5856
fail-fast: false
5957
matrix:
6058
node: [16]
61-
os: [ubuntu-latest, macos-latest, windows-latest]
59+
os: [ubuntu-latest, macos-latest, windows-2019]
6260
include:
6361
- node: 14
6462
os: ubuntu-latest
@@ -74,9 +72,7 @@ jobs:
7472
cache: 'pnpm'
7573
cache-dependency-path: '**/pnpm-lock.yaml'
7674
- name: install
77-
run: |
78-
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
79-
node node_modules/esbuild/install.js
75+
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
8076
- name: build
8177
run: pnpm run build:ci
8278
- name: run tests

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ jobs:
3232
cache: 'pnpm'
3333
cache-dependency-path: '**/pnpm-lock.yaml'
3434
- name: install
35-
run: |
36-
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
37-
node node_modules/esbuild/install.js
35+
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
3836

3937
- name: Creating .npmrc
4038
run: |

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"svelte": "^3.46.2",
5858
"ts-jest": "^27.1.3",
5959
"typescript": "^4.5.4",
60-
"vite": "^2.7.12"
60+
"vite": "^2.7.13"
6161
},
6262
"lint-staged": {
6363
"*.{js,ts,svelte,html,md,svx}": "eslint --fix",
@@ -74,7 +74,7 @@
7474
"pnpm": {
7575
"overrides": {
7676
"@sveltejs/vite-plugin-svelte": "workspace:*",
77-
"vite": "^2.7.10",
77+
"vite": "^2.7.13",
7878
"ansi-regex@>2.1.1 <5.0.1": "^5.0.1"
7979
}
8080
}

packages/e2e-tests/autoprefixer-browerslist/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"postcss-load-config": "^3.1.1",
1818
"svelte": "^3.46.2",
1919
"svelte-preprocess": "^4.10.2",
20-
"vite": "^2.7.12"
20+
"vite": "^2.7.13"
2121
}
2222
}

packages/e2e-tests/configfile-custom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"devDependencies": {
1414
"@sveltejs/vite-plugin-svelte": "workspace:*",
1515
"svelte": "^3.46.2",
16-
"vite": "^2.7.12"
16+
"vite": "^2.7.13"
1717
}
1818
}

packages/e2e-tests/configfile-esm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@sveltejs/vite-plugin-svelte": "workspace:*",
1515
"svelte": "^3.46.2",
1616
"svelte-preprocess": "^4.10.2",
17-
"vite": "^2.7.12"
17+
"vite": "^2.7.13"
1818
},
1919
"type": "module"
2020
}

packages/e2e-tests/custom-extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"devDependencies": {
1111
"@sveltejs/vite-plugin-svelte": "workspace:*",
1212
"svelte": "^3.46.2",
13-
"vite": "^2.7.12"
13+
"vite": "^2.7.13"
1414
}
1515
}

packages/e2e-tests/env/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"devDependencies": {
1111
"@sveltejs/vite-plugin-svelte": "workspace:*",
1212
"svelte": "^3.46.2",
13-
"vite": "^2.7.12"
13+
"vite": "^2.7.13"
1414
},
1515
"type": "module"
1616
}

packages/e2e-tests/hmr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"@sveltejs/vite-plugin-svelte": "workspace:*",
1515
"node-fetch": "^2.6.6",
1616
"svelte": "^3.46.2",
17-
"vite": "^2.7.12"
17+
"vite": "^2.7.13"
1818
}
1919
}

0 commit comments

Comments
 (0)