mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
With this patch:
Users can now include assets by adding a key-path dictionary
to the configuration as the `assets` field. At build time, Node.js
would read the assets from the specified paths and bundle them into
the preparation blob. In the generated executable, users can retrieve
the assets using the `sea.getAsset()` and `sea.getAssetAsBlob()` API.
```json
{
"main": "/path/to/bundled/script.js",
"output": "/path/to/write/the/generated/blob.blob",
"assets": {
"a.jpg": "/path/to/a.jpg",
"b.txt": "/path/to/b.txt"
}
}
```
The single-executable application can access the assets as follows:
```cjs
const { getAsset } = require('node:sea');
// Returns a copy of the data in an ArrayBuffer
const image = getAsset('a.jpg');
// Returns a string decoded from the asset as UTF8.
const text = getAsset('b.txt', 'utf8');
// Returns a Blob containing the asset.
const blob = getAssetAsBlob('a.jpg');
```
Drive-by: update the documentation to include a section dedicated
to the injected main script and refer to it as "injected main
script" instead of "injected module" because it's a script, not
a module.
PR-URL: https://github.com/nodejs/node/pull/50960
Refs: https://github.com/nodejs/single-executable/issues/68
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
61 lines
2.0 KiB
Plaintext
61 lines
2.0 KiB
Plaintext
prefix sequential
|
|
|
|
# To mark a test as flaky, list the test name in the appropriate section
|
|
# below, without ".js", followed by ": PASS,FLAKY". Example:
|
|
# sample-test : PASS,FLAKY
|
|
|
|
[true] # This section applies to all platforms
|
|
# https://github.com/nodejs/node/issues/27611#issuecomment-613100468
|
|
test-cpu-prof-dir-worker: PASS, FLAKY
|
|
# https://github.com/nodejs/node/issues/44898
|
|
test-watch-mode: PASS, FLAKY
|
|
test-watch-mode-inspect: PASS, FLAKY
|
|
# https://github.com/nodejs/node/issues/47409
|
|
test-http2-large-file: PASS, FLAKY
|
|
|
|
[$system==win32]
|
|
# https://github.com/nodejs/node/issues/47116
|
|
test-http-max-sockets: PASS, FLAKY
|
|
# https://github.com/nodejs/node/issues/49630
|
|
test-single-executable-application-snapshot: PASS, FLAKY
|
|
test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY
|
|
|
|
[$system==linux]
|
|
|
|
[$system==macos]
|
|
|
|
[$system==solaris] # Also applies to SmartOS
|
|
|
|
[$system==freebsd]
|
|
|
|
[$system==aix]
|
|
# https://github.com/nodejs/node/pull/29054
|
|
test-buffer-creation-regression: SKIP
|
|
|
|
[$system==ibmi]
|
|
# https://github.com/nodejs/node/pull/29054
|
|
test-buffer-creation-regression: SKIP
|
|
# https://github.com/nodejs/node/pull/30819
|
|
test-perf-hooks: SKIP
|
|
# https://github.com/nodejs/node/issues/39683
|
|
test-tls-psk-client: PASS, FLAKY
|
|
test-tls-securepair-client: PASS, FLAKY
|
|
|
|
[$arch==arm]
|
|
# https://github.com/nodejs/node/issues/49933
|
|
test-watch-mode-inspect: SKIP
|
|
|
|
[$arch==s390x]
|
|
# https://github.com/nodejs/node/issues/41286
|
|
test-performance-eventloopdelay: PASS, FLAKY
|
|
|
|
[$system==linux && $arch==ppc64]
|
|
# https://github.com/nodejs/node/issues/50740
|
|
test-single-executable-application-assets: PASS, FLAKY
|
|
test-single-executable-application-disable-experimental-sea-warning: PASS, FLAKY
|
|
test-single-executable-application-empty: PASS, FLAKY
|
|
test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY
|
|
test-single-executable-application-snapshot: PASS, FLAKY
|
|
test-single-executable-application-use-code-cache: PASS, FLAKY
|
|
test-single-executable-application: PASS, FLAKY
|