Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WebApp Node API Example (Experimental JS Bundler) w/ Virtual Modules
const { webapp, register } = require('webapp');
async function main() {
const input = register('./input.js')`
const msg = 'Hello world!';
console.log(msg);
`;
const { source } = await webapp({
input,
// Ensure that no filesystem configuration files are consumed.
config: null,
// It is important to disable cache, to avoid writing out to the FS.
disableCache: true,
});
console.log(source.code);
}
main();
// const a="Hello world!";console.log(a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.