Skip to content

Commit

Permalink
fix: readme: internals
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser authored Feb 19, 2024
1 parent 080b5df commit 375e409
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ import {bundle} from '@putout/bundler';
console.log(bundle(CWD, entry, filesystem));
```

## Convert ESM to CommonJS
## Internals

### Convert ESM to CommonJS

To Simplify things up all files converted to CommonJS first.
Let's suppose none of them use top-level await to get things simpler.

## Parse filenames
### Parse filenames

Traverse all files starting from `entry` and get all filenames.

Expand All @@ -38,7 +40,7 @@ Traverse all files starting from `entry` and get all filenames.
- [`resolve-require`](https://putout.cloudcmd.io/#/gist/833539f66cb238fcc3b6ca6cee61ef9e/79a068c96b686bb0eacdf3f570d532981499b114);
- [`bundle-files`](https://putout.cloudcmd.io/#/gist/7dd3bffa8e88f7542c84065f622b63d7/3b1e68e0babc3a72af947076ed9801c0034a096e);

## Bundle all files to object
### Bundle all files to object

Traverse filesystem and create object that contains filename and file content:

Expand All @@ -54,11 +56,11 @@ const __filesystem = {
};
```

## IIFE
### IIFE

Most likely we need IIFE so couple bundles can be loaded on page simultaneously.

## Result Example
### Result Example

```js
const __modules = {};
Expand Down

0 comments on commit 375e409

Please sign in to comment.