-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support custom pkg entrypoints, useful for Svelte projects (#1457)
* support passing custom package manifest entrypoints to esinstall * support custom lookup entrypoint fields
- Loading branch information
1 parent
eda2e94
commit 29558d8
Showing
10 changed files
with
76 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`snowpack install config-package-lookup-fields: allFiles 1`] = ` | ||
Array [ | ||
"import-map.json", | ||
"some-svelte-package.js", | ||
] | ||
`; | ||
|
||
exports[`snowpack install config-package-lookup-fields: cli output 1`] = ` | ||
"[snowpack] installing dependencies... | ||
[snowpack] ✔ install complete! | ||
[snowpack] | ||
⦿ web_modules/ size gzip brotli | ||
└─ some-svelte-package.js XXXX KB XXXX KB XXXX KB" | ||
`; | ||
|
||
exports[`snowpack install config-package-lookup-fields: web_modules/import-map.json 1`] = ` | ||
"{ | ||
\\"imports\\": { | ||
\\"some-svelte-package\\": \\"./some-svelte-package.js\\" | ||
} | ||
}" | ||
`; | ||
|
||
exports[`snowpack install config-package-lookup-fields: web_modules/some-svelte-package.js 1`] = `"console.log('TEST: THIS IS THE GOOD ENTRYPOINT');"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"private": true, | ||
"version": "1.0.1", | ||
"name": "@snowpack/test-config-package-lookup-fields", | ||
"description": "Handle custom packageLookupFields", | ||
"scripts": { | ||
"testinstall": "snowpack" | ||
}, | ||
"snowpack": { | ||
"installOptions": { | ||
"packageLookupFields": ["svelte"] | ||
} | ||
}, | ||
"dependencies": { | ||
"some-svelte-package": "file:./packages/some-svelte-package" | ||
}, | ||
"devDependencies": { | ||
"snowpack": "^2.14.3" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
test/esinstall/config-package-lookup-fields/packages/some-svelte-package/bad.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('TEST: THIS IS THE BAD ENTRYPOINT'); |
1 change: 1 addition & 0 deletions
1
test/esinstall/config-package-lookup-fields/packages/some-svelte-package/good.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('TEST: THIS IS THE GOOD ENTRYPOINT'); |
6 changes: 6 additions & 0 deletions
6
test/esinstall/config-package-lookup-fields/packages/some-svelte-package/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"version": "1.0.0", | ||
"name": "some-svelte-package", | ||
"svelte": "good.js", | ||
"module": "bad.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'some-svelte-package'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29558d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: