Last active
August 20, 2018 04:50
-
-
Save tbranyen/99227943cbb1fd6de3b003ac8e6e5893 to your computer and use it in GitHub Desktop.
WebApp Node API Example (Experimental JS Bundler) w/ Virtual Modules
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
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