Hi, there I an example of a package.json where I can see how to configure the multiple entry modules or any documentation?
Also, when I try to call the bundled js file example (src/Assembler.ts becomes dist/Assembler.js) I get the error
ReferenceError: Can't find variable: module
Hi, not sure if I understand correctly but multiple entries are not yet supported by microbundle (AFAIK). See https://github.com/developit/microbundle/issues/50
For your second question it would help if you could provide steps to reproduce the problem. Seems as if it's tied to your application code
Too bad for the multiple entries.
For the second question.
I have a Typescript project the directory is:
assembler/
When I compile using micro bundler it creates the dist folder with the final Assembler.js that contains the rest of the ts files as a single file.
But when I open index.html that in turn calls index.js I get the error:
SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.
Uncaught SyntaxError: The requested module './dist/Assembler.js' does not provide an export named 'default'
I want to know if I can open the files created by Microbundler from a local server without needing web pack.
Update: I manage to get the code running by importing Assembler.mjs instead of .js inside the index.js file
Microbundle does support multiple entries that produce multiple outputs:
{
"main": "dist/Assembler.js",
"scripts": {
"build": "microbundle src/*.ts"
}
}
This will produce the following structure:
dist/
a.js
b.js
c.js
src/
a.ts
b.ts
c.ts
lib/
other.ts <-- `src/*.ts` does not match this, so it will be bundled into a, b and c
Most helpful comment
Microbundle does support multiple entries that produce multiple outputs:
This will produce the following structure: