@hugov/unnode
v0.0.4
Published
bundle imported node_modules
Downloads
1
Readme
@hugov/unnode
minimal bundling for near unbundled web development
Example
// import bundled files from /webmodules and ./webmodules
import a from '/webmodules/moduleName.js' // import a from 'moduleName' in node
import b from '/webmodules/moduleName/index.js' // import b from 'moduleName' in node
import('./web_modules/moduleName/src/util.js') // import ('moduleName/src/util.js') in node
## target dir chain of esbuild options
unnode web_modules minify sourcemap=true # will bundle all references starting with /webmodules
Notes
- used for static site where the source code is served unbundled, as is (e.g. GH pages)
- source html and js files are never changed and can be served as-is
- only bundle node_modules that are requested in the source files
- bundle once, even if imported multiple times
- local ./bundles or shared /bundles
- import bare modules
myModule.js
or parts of a modulemyModule/src/util.js
- esbuild build options
see schem.ist source code for example use