Skip to content

Commit

Permalink
Remove prepareESM Rollup build step entirely.
Browse files Browse the repository at this point in the history
Since we aren't using Rollup to apply the invariant transform anymore, it
turns out we don't need this build step at all. Instead, the CJS bundles
will be generated directly from the modules generated by tsc and processed
by the invariant transform.
  • Loading branch information
benjamn committed Jul 20, 2020
1 parent 687eaa3 commit 627bd1b
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,6 @@ const external = [
'zen-observable',
];

function prepareESM(input, outputDir) {
return {
input,
external,
output: {
dir: outputDir,
format: 'esm',
sourcemap: true,
},
// The purpose of this job is to ensure each `./dist` ESM file is run
// through the `invariantPlugin`, with any resulting changes added
// directly back into each ESM file. By setting `preserveModules`
// to `true`, we're making sure Rollup doesn't attempt to create a single
// combined ESM bundle with the final result of running this job.
preserveModules: true,
plugins: [
nodeResolve(),
],
};
}

function prepareCJS(input, output) {
return {
input,
Expand Down Expand Up @@ -140,7 +119,6 @@ function prepareBundle({
}

export default [
prepareESM(packageJson.module, distDir),
prepareCJS(packageJson.module, packageJson.main),
prepareCJSMinified(packageJson.main),
...entryPoints.map(prepareBundle),
Expand Down

0 comments on commit 627bd1b

Please sign in to comment.