Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

rename boot.cjs to unzip.cjs#73

Merged
Rich-Harris merged 2 commits intomainfromrename-boot-to-unzip
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionsscripts/create-common-bundle/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,10 +60,10 @@ fs.writeFileSync(`src/lib/client/adapters/common/common.zip`, out);

// bundle adm-zip so we can use it in the webcontainer
esbuild.buildSync({
entryPoints: [fileURLToPath(new URL('./boot.js', import.meta.url))],
entryPoints: [fileURLToPath(new URL('./unzip.js', import.meta.url))],
bundle: true,
platform: 'node',
minify: true,
outfile: 'src/lib/client/adapters/common/boot.cjs',
outfile: 'src/lib/client/adapters/common/unzip.cjs',
format: 'cjs'
});
2 changes: 1 addition & 1 deletionsrc/lib/client/adapters/common/.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
/boot.cjs
/unzip.cjs
/common.zip
6 changes: 3 additions & 3 deletionssrc/lib/client/adapters/common/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
import zipped from './common.zip?url';
importboot from './boot.cjs?url';
importunzip from './unzip.cjs?url';

async function load() {
const result = await Promise.all([
fetch(zipped).then((r) => r.arrayBuffer()),
fetch(boot).then((r) => r.text())
fetch(unzip).then((r) => r.text())
]);

return {
zipped: result[0],
boot: result[1]
unzip: result[1]
};
}

Expand Down
10 changes: 5 additions & 5 deletionssrc/lib/client/adapters/webcontainer/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,22 +14,22 @@ export async function create(stubs) {

const common = await ready;
tree['common.zip'] = file(new Uint8Array(common.zipped));
tree['boot.cjs'] = file(common.boot);
tree['unzip.cjs'] = file(common.unzip);

const vm = await WebContainer.boot();
await vm.loadFiles(tree);

constboot = await vm.run(
constunzip = await vm.run(
{
command: 'node',
args: ['boot.cjs']
args: ['unzip.cjs']
},
{
stderr: (data) => console.error(`[boot] ${data}`)
stderr: (data) => console.error(`[unzip] ${data}`)
}
);

const code = awaitboot.onExit;
const code = awaitunzip.onExit;

if (code !== 0) {
throw new Error('Failed to initialize WebContainer');
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp