Tools
Booting container...
Three jiki plugins working together: a CSS stub plugin that handles .css imports, a virtual environment plugin that provides @env as a virtual module, and a banner plugin that prepends a comment to every .js file.
What’s inside
- The virtual-env plugin uses
onResolve+onLoadto interceptrequire("@env")and return a JavaScript object without any file on disk - The css-stub plugin uses
onLoadto return an empty object for.cssimports, preventing errors - The banner plugin uses
onTransformto modify source code before execution, adding a comment to every.jsfile - All three plugins compose without conflicts
Try it yourself
- Run
node app.jsto see the virtual environment variables - Run
node style-test.jsto see CSS import stubbing in action - Run
node banner-test.jsto see code transformation - Edit
app.jsto add newrequire("@env")usage