-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
298 additions
and
37 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
7 changes: 7 additions & 0 deletions
7
crates/rolldown/tests/fixtures/loaders/binary/binary/_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,7 @@ | ||
{ | ||
"config": { | ||
"moduleTypes": { | ||
".webp": "binary" | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
crates/rolldown/tests/fixtures/loaders/binary/binary/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,21 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/fixtures/loaders/binary/binary | ||
--- | ||
# Assets | ||
|
||
## main.mjs | ||
|
||
```js | ||
//#region rolldown.webp | ||
var rolldown_default = __toBinary('UklGRgoKAABXRUJQVlA4WAoAAAAQAAAAXwAAXwAAQUxQSIACAAABkCNt/5tGP42DZjSqVEmjFs4htY6lnCqoUsNNuEA6gAMVJ9iIKyqcGMeOWIY/3v9vAyDp//9m64iYAFLTcMJytdV5niwkzycvt61qKXAMQume1+6WnODyrnbhAvArXwWnuPha8bXaOm4LTl20j7Z0sUp9VrRfsHQwix+s8HvBVG6vx4r39tTyLn+x8vLSU8c4G7GWo1NDEbshWVPZtJXIdFnjblaBYMBaD8PUohlrPo9SygnWXuRTyX8ywM9cCpFgiCJKLJwxyHmQUHbIMIeZROwuA+3aCRhNhto04p1KLPIsljdisCMvziXDvYyxJ/HIvY3MHgPumZsUGHJxA+sd04e1rsCgS2u2+qj6W6uOOF2pjozHx6vaKWndXuELXML/p8LAK/98QfaViNwFMuESXTD0c6IathoZd9juDGeJbekEDD4soStX0VVb6Fq36Dov6J6n6CZzdHP+71+gm0/QTV7WSFQvnTWwOy10rSq6ahldKUQXOEtsS8e4w3ZnUA1bnegc2wWRK5AtXCL6iuwrEVEFWeUfX+Ba+P9QG1ebVh7jOlq11UfV31pFJVQFWmt9YHq31lExFamOjFWgDc1eGvr2zE1oT+KRe7T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FiXaWO7eI1ID7fteXqr8y3zFn08xT4HdC6DjRb9bFX/IAkyWdzGAu1bpTVC02BVoJFa0PoGboq42Hwtpq1Yvp6LiIb5NU9LJ4EYRFHwEeOKLHas0PUN8UeiR+3zRTGCK38+ihBF4IL8IWvjQspsbbOperpfCxOq7tgLljv+Dj5ZrtPWolBGkY+YAj0KGuLYPXphkmZ3he7+UY9iGvgVNmHwMqrJs9RhAHrsbmBNdF/OD9tDFTyY/eroy6BYmBP1sd0BxMpQCO0wipCQB07biLfiz0iGQh/j5pbbiooso3ysDKgU6iEAENZ7GQtgcTxDAhPN5g/Y2OvfstKWAzeNAcgrfAfHreS9Cfa6M8NOpboCUg0xhYa7vBdl5VguSL4nHoDYDiztuQGrx4OgYPAtRFiVfWhdOCWLSXZ4ljQGi+KW3rG5V0X01dYZz6evIXP9wqHhkekw2K4y842vn82Rb6t+Pi6pgups0s1uNfLhui1LRbW34my38Go3JeuNaxQAfyW+4LPx9LvOHRxLR8XmMi3TGw1pSsP0Je64S2R4lD6XxOa/ujg+hf3Z3//R///o4r//ovn/9unf+Ebnn8cZgMBAwsVra6s78StHcigPdOIHNGzgAAAA=='); | ||
//#endregion | ||
//#region main.js | ||
console.log(rolldown_default); | ||
//#endregion | ||
``` |
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,3 @@ | ||
import value from './rolldown.webp'; | ||
|
||
console.log(value); |
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
crates/rolldown/tests/fixtures/loaders/binary/empty/_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,7 @@ | ||
{ | ||
"config": { | ||
"moduleTypes": { | ||
".data": "binary" | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
crates/rolldown/tests/fixtures/loaders/binary/empty/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,21 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/fixtures/loaders/binary/empty | ||
--- | ||
# Assets | ||
|
||
## main.mjs | ||
|
||
```js | ||
//#region example.data | ||
var example_default = __toBinary(''); | ||
//#endregion | ||
//#region main.js | ||
console.log(example_default); | ||
//#endregion | ||
``` |
Empty file.
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,3 @@ | ||
import value from './example.data' | ||
|
||
console.log(value); |
8 changes: 8 additions & 0 deletions
8
crates/rolldown/tests/fixtures/loaders/binary/node/_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,8 @@ | ||
{ | ||
"config": { | ||
"moduleTypes": { | ||
".data": "binary" | ||
}, | ||
"platform": "node" | ||
} | ||
} |
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 @@ | ||
import buffer from './dist/main.mjs'; | ||
import assert from 'node:assert'; | ||
import fs from 'node:fs/promises'; | ||
import path from 'node:path'; | ||
|
||
assert((await fs.readFile(path.resolve(import.meta.dirname, 'text.data'))).equals(buffer)); |
23 changes: 23 additions & 0 deletions
23
crates/rolldown/tests/fixtures/loaders/binary/node/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,23 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/fixtures/loaders/binary/node | ||
--- | ||
# Assets | ||
|
||
## main.mjs | ||
|
||
```js | ||
//#region text.data | ||
var text_default = __toBinaryNode('IidgKz0vQCMkJCVeJiooCuS9oOWlve+8jOS4lueVjArQn9GA0LjQstC10YIg0LzQuNGACuOBk+OCk+OBq+OBoeOBr+S4lueVjAo='); | ||
//#endregion | ||
//#region main.js | ||
console.log(text_default); | ||
var main_default = text_default; | ||
//#endregion | ||
export { main_default as default }; | ||
``` |
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,5 @@ | ||
import value from './text.data' | ||
|
||
console.log(value); | ||
|
||
export default value; |
Oops, something went wrong.