-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat: allow to use node module specifier as the bundle input (#211)
* feat: allow to use node module specifier as the bundle input * Tweak * Update yarn.lock
Showing
16 changed files
with
231 additions
and
32 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
1 change: 1 addition & 0 deletions
1
crates/rolldown/tests/fixtures/resolve/node_modules_as_entries/.gitignore
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 @@ | ||
!node_modules |
4 changes: 4 additions & 0 deletions
4
crates/rolldown/tests/fixtures/resolve/node_modules_as_entries/_test.mjs
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,4 @@ | ||
import assert from 'assert' | ||
import isPlainObject from './dist/is-plain-obj.mjs' | ||
|
||
assert(isPlainObject({})) |
22 changes: 22 additions & 0 deletions
22
crates/rolldown/tests/fixtures/resolve/node_modules_as_entries/artifacts.snap
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,22 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/fixtures/resolve/node_modules_as_entries | ||
--- | ||
# Assets | ||
|
||
## is-plain-obj.mjs | ||
|
||
```js | ||
// node_modules/is-plain-obj/index.js | ||
function isPlainObject(value) { | ||
if (typeof value !== 'object' || value === null) { | ||
return false; | ||
} | ||
const prototype = Object.getPrototypeOf(value); | ||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); | ||
} | ||
export { isPlainObject as default }; | ||
``` |
2 changes: 2 additions & 0 deletions
2
crates/rolldown/tests/fixtures/resolve/node_modules_as_entries/main.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,2 @@ | ||
import * as pkg from 'is-plain-obj' | ||
export default pkg |
35 changes: 35 additions & 0 deletions
35
...ldown/tests/fixtures/resolve/node_modules_as_entries/node_modules/is-plain-obj/index.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...olldown/tests/fixtures/resolve/node_modules_as_entries/node_modules/is-plain-obj/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...rolldown/tests/fixtures/resolve/node_modules_as_entries/node_modules/is-plain-obj/license
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
...own/tests/fixtures/resolve/node_modules_as_entries/node_modules/is-plain-obj/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
...ts/fixtures/resolve/node_modules_as_entries/node_modules/is-plain-obj/readme.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
crates/rolldown/tests/fixtures/resolve/node_modules_as_entries/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,7 @@ | ||
{ | ||
"name": "pre_bundle_react_react_dom", | ||
"dependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
crates/rolldown/tests/fixtures/resolve/node_modules_as_entries/test.config.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,10 @@ | ||
{ | ||
"input": { | ||
"input": [ | ||
{ | ||
"name": "is-plain-obj", | ||
"import": "is-plain-obj" | ||
} | ||
] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -17,4 +17,4 @@ | |
"sideEffects": [ | ||
"./snippets/*" | ||
] | ||
} | ||
} |