You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
- The [`rollup`](https://www.npmjs.com/package/rollup) npm package contains both Rollup's Node.js JavaScript interface and the command-line-interface (CLI).
6
6
- There is a separate browser build available as [`@rollup/browser`](https://www.npmjs.com/package/@rollup/browser). It exposes the same JavaScript interface as the Node.js build but does not include the CLI and also requires writing a plugin to encapsulate file reading. Instead of native code dependencies, this build has a bundled WASM artifact included that can be loaded in the browser. This is what the [Rollup REPL](https://rollupjs.org/repl) uses.
7
-
- For every supported platform-architecture combination, there is a separate pacakge containing the native code. These are not listed in the committed `package.json` file but are added dynamically during publishing as `optionalDependencies`. The `README.md` and `package.json` files for those dependencies can be found in the [`npm`](npm) folder. The corresponding binaries are built and published from [GitHub Actions](.github/workflows/build-and-tests.yml) whenever a new release version tag is pushed. The actual loading of the native code is handled by [`native.js`](native.js) which is copied into the output folder during build. So to add a new platform-architecture combination, you need to
7
+
- For every supported platform-architecture combination, there is a separate package containing the native code. These are not listed in the committed `package.json` file but are added dynamically during publishing as `optionalDependencies`. The `README.md` and `package.json` files for those dependencies can be found in the [`npm`](npm) folder. The corresponding binaries are built and published from [GitHub Actions](.github/workflows/build-and-tests.yml) whenever a new release version tag is pushed. The actual loading of the native code is handled by [`native.js`](native.js) which is copied into the output folder during build. So to add a new platform-architecture combination, you need to
8
8
- add a new package in the `npm` folder
9
9
- update the `native.js` file
10
10
- add the corresponding triple to the [`package.json`](package.json) file as napi-rs depends on this
@@ -24,7 +24,7 @@
24
24
- The entry point for the Node.js build is [`node-entry.ts`](src/node-entry.ts) while the browser build uses [`browser-entry.ts`](src/browser-entry.ts). Those are mostly identical except that the browser build does not expose the watch mode interface.
25
25
- The CLI is a wrapper around the JavaScript interface.
26
26
- It resides in the [`cli` folder](cli) with the entry point [cli.ts](cli/cli.ts).
27
-
- The logic to read configuration files resides in [locaConfigFile.ts](cli/run/loadConfigFile.ts) and is exposed as a separate export via `import { loadConfigFile } from "rollup/loadConfigFile"`.
27
+
- The logic to read configuration files resides in [loadConfigFile.ts](cli/run/loadConfigFile.ts) and is exposed as a separate export via `import { loadConfigFile } from "rollup/loadConfigFile"`.
28
28
- Only the CLI is able to handle arrays of configurations. Those are handled sequentially in [`run/index.ts`](cli/run/index.ts).
29
29
- The CLI handles several CLI-only options that are specific to the Node.js environment like setting environment variables or handling std-in, see [Command line flags](docs/command-line-interface/index.md#command-line-flags).
30
30
@@ -42,7 +42,7 @@ The Rust entrypoints are [`bindings_napi/src/lib.rs`](rust/bindings_napi/src/lib
42
42
43
43
Building an output has two phases
44
44
45
-
- The "build" phase builds a module graph form the input files and decides, which code should be included in the output
45
+
- The "build" phase builds a module graph from the input files and decides, which code should be included in the output
46
46
- It is triggered by calling the `rollup(inputOptions)` function exported by the JavaScript interface
47
47
- It returns a "bundle" object that has `generate` and `write` methods
48
48
- The "generate" phase generates the output files from the bundle by calling `.generate(outputOptions)` or `.write(outputOptions)`
@@ -96,14 +96,14 @@ To understand this phase from a plugin perspective, have a look at [Build Hooks]
96
96
97
97
To understand this phase from a plugin perspective, have a look at [Output Generation Hooks](https://rollupjs.org/plugin-development/#output-generation-hooks), which again contains a graph to show in which order these hooks are executed. In detail `Bundle.generate` performs the following steps
98
98
99
-
- Assign modules to chunks via [`chunkAssigment.ts`](src/utils/chunkAssignment.ts)
99
+
- Assign modules to chunks via [`chunkAssignment.ts`](src/utils/chunkAssignment.ts)
100
100
- Determine the exports for each chunk by tracing the included inter-module dependencies
101
101
- Render the chunks, which is orchestrated by the [`renderChunks`](src/utils/renderChunks.ts) helper
102
102
- Render the chunks with placeholders for chunk hashes by calling `Chunk.render()`
103
103
- Determine how dynamic imports and `import.meta` references should be resolved and store this on the corresponding AST nodes.
104
104
- Determine the final deconflicted variable names and store those on the AST nodes as well in [`deconflictChunk.ts`](src/utils/deconflictChunk.ts)
105
105
- Render each module by calling the `.render` methods of their AST nodes. This is also where tree-shaken nodes are removed from the output.
106
-
- Render the format specific wrapper with imports and exports for this chunk by calling the corresponding [finalizer](src/finalisers).
106
+
- Render the format specific wrapper with imports and exports for this chunk by calling the corresponding [finaliser](src/finalisers).
107
107
- Transform the rendered chunks via the [`renderChunk`](https://rollupjs.org/plugin-development/#renderchunk) plugin hook
108
108
- Determine the final chunk hashes based on the actual rendered content and the chunk dependency graph and replace the placeholders
0 commit comments