Skip to content

Commit 4018ce6

Browse files
authored
Feat: async load config esm (#35)
* feat(vite-plugin-svelte): support esm in svelte.config.js (see #29) * update vite to 2.2.1 and update other dependencies * chore: update dependencies * test: improve stability * feat: add configFile option; use require to load cjs config * also try to load svelte.config.mjs * chore: update dependencies * improve changesets
1 parent 976f0c8 commit 4018ce6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+972
-617
lines changed

.changeset/blue-schools-bake.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': minor
3+
---
4+
5+
Feature: Support esm in svelte.config.js and svelte.config.mjs

.changeset/little-plums-grab.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': minor
3+
---
4+
5+
Feature: add configFile option

.ncurc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
packageFile: ['package.json', 'packages/**/package.json'],
3-
reject: ['husky']
3+
reject: ['husky', 'esbuild', 'slash']
44
};

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@
2727
"release": "pnpm run build && pnpx --no changeset publish"
2828
},
2929
"devDependencies": {
30-
"@changesets/changelog-github": "^0.3.0",
31-
"@changesets/cli": "^2.15.0",
32-
"@microsoft/api-extractor": "^7.13.2",
33-
"@types/fs-extra": "^9.0.10",
30+
"@changesets/changelog-github": "^0.4.0",
31+
"@changesets/cli": "^2.16.0",
32+
"@microsoft/api-extractor": "^7.14.0",
33+
"@types/fs-extra": "^9.0.11",
3434
"@types/jest": "^26.0.22",
35-
"@types/node": "^14.14.37",
36-
"@types/semver": "^7.3.4",
37-
"@typescript-eslint/eslint-plugin": "^4.20.0",
38-
"@typescript-eslint/parser": "^4.20.0",
39-
"chalk": "^4.1.0",
35+
"@types/node": "^14.14.41",
36+
"@types/semver": "^7.3.5",
37+
"@typescript-eslint/eslint-plugin": "^4.22.0",
38+
"@typescript-eslint/parser": "^4.22.0",
39+
"chalk": "^4.1.1",
4040
"cross-env": "^7.0.3",
4141
"enquirer": "^2.3.6",
4242
"esbuild": "~0.9.7",
43-
"eslint": "^7.23.0",
44-
"eslint-config-prettier": "^8.1.0",
43+
"eslint": "^7.25.0",
44+
"eslint-config-prettier": "^8.3.0",
4545
"eslint-plugin-html": "^6.1.2",
46-
"eslint-plugin-jest": "^24.3.3",
47-
"eslint-plugin-markdown": "^2.0.0",
46+
"eslint-plugin-jest": "^24.3.6",
47+
"eslint-plugin-markdown": "^2.1.0",
4848
"eslint-plugin-node": "^11.1.0",
49-
"eslint-plugin-prettier": "^3.3.1",
50-
"eslint-plugin-svelte3": "^3.1.2",
49+
"eslint-plugin-prettier": "^3.4.0",
50+
"eslint-plugin-svelte3": "^3.2.0",
5151
"execa": "^5.0.0",
5252
"fs-extra": "^9.1.0",
5353
"husky": "^4.3.8",
@@ -57,23 +57,23 @@
5757
"lint-staged": "^10.5.4",
5858
"minimist": "^1.2.5",
5959
"node-fetch": "^2.6.1",
60-
"npm-check-updates": "^11.3.0",
60+
"npm-check-updates": "^11.5.1",
6161
"npm-run-all": "^4.1.5",
6262
"playwright-core": "^1.10.0",
63-
"pnpm": "^6.0.1",
63+
"pnpm": "^6.2.1",
6464
"prettier": "^2.2.1",
6565
"prettier-plugin-svelte": "^2.2.0",
6666
"rimraf": "^3.0.2",
6767
"semver": "^7.3.5",
6868
"sirv": "^1.0.11",
6969
"slash": "^3.0.0",
70-
"stylelint": "^13.12.0",
70+
"stylelint": "^13.13.0",
7171
"stylelint-config-prettier": "^8.0.2",
72-
"stylelint-config-recommended": "^4.0.0",
72+
"stylelint-config-recommended": "^5.0.0",
7373
"svelte": "^3.37.0",
74-
"ts-jest": "^26.5.4",
75-
"typescript": "^4.2.3",
76-
"vite": "^2.1.5"
74+
"ts-jest": "^26.5.5",
75+
"typescript": "^4.2.4",
76+
"vite": "^2.2.3"
7777
},
7878
"husky": {
7979
"hooks": {

packages/playground/autoprefixer-browerslist/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"devDependencies": {
1313
"@sveltejs/vite-plugin-svelte": "workspace:*",
1414
"autoprefixer": "^10.2.5",
15-
"postcss": "^8.2.9",
15+
"postcss": "^8.2.12",
1616
"postcss-load-config": "^3.0.1",
1717
"svelte": "^3.37.0",
18-
"svelte-hmr": "^0.14.0",
19-
"svelte-preprocess": "^4.7.0",
20-
"vite": "^2.1.5"
18+
"svelte-hmr": "^0.14.2",
19+
"svelte-preprocess": "^4.7.2",
20+
"vite": "^2.2.3"
2121
}
2222
}

packages/playground/big/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"devDependencies": {
1313
"@sveltejs/vite-plugin-svelte": "workspace:*",
1414
"svelte": "^3.37.0",
15-
"svelte-hmr": "^0.14.0",
16-
"vite": "^2.1.5"
15+
"svelte-hmr": "^0.14.2",
16+
"vite": "^2.2.3"
1717
}
1818
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules/
2+
/public/build/
3+
4+
.DS_Store
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# default svelte app template
2+
3+
Created with `npx degit sveltejs/template`
4+
5+
adapted to vite by moving index.html to root and replacing rollup config with vite
6+
7+
use pnpm
8+
9+
`pnpm dev` starts dev server
10+
`pnpm build` builds for production
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
it('should load config and work', async () => {
2+
expect(await page.textContent('h1')).toMatch('Hello world!');
3+
});

0 commit comments

Comments
 (0)