Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Resolved conflicts by taking GitHub versions for: - .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml Kept deploy.sh updated to: - Pull from GitHub (primary source) - Push to Gitea (push-mirror) - Build from site/ directory (GitHub structure) Co-Authored-By: Paperclip <noreply@paperclip.ing>
30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
/**
|
|
* This module provides a way to install SWC bindings without eagerly loading the entire swc/index module.
|
|
*
|
|
* The swc/index module can transitively load other modules (like webpack-config) that import React,
|
|
* and React's entry point checks process.env.NODE_ENV at require time to decide whether to load
|
|
* the development or production bundle. By deferring the require of swc/index until this function
|
|
* is called, we ensure NODE_ENV is set before React is loaded.
|
|
*/ /**
|
|
* Loads and caches the native bindings. This is idempotent and should be called early so bindings
|
|
* can be accessed synchronously later.
|
|
*
|
|
* @param useWasmBinary - Whether to use WASM bindings instead of native bindings
|
|
*/ "use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "installBindings", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return installBindings;
|
|
}
|
|
});
|
|
async function installBindings(useWasmBinary = false) {
|
|
// Lazy require to avoid loading swc/index (and transitively webpack-config/React)
|
|
// before NODE_ENV is set
|
|
const { loadBindings } = require('./index');
|
|
await loadBindings(useWasmBinary);
|
|
}
|
|
|
|
//# sourceMappingURL=install-bindings.js.map
|