-
Notifications
You must be signed in to change notification settings - Fork 994
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b86898a
commit 4e1c3c5
Showing
4 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { writeFileSync } from 'node:fs' | ||
|
||
import { build, defaultBuildOptions } from '@redwoodjs/framework-tools' | ||
|
||
// ESM build | ||
await build({ | ||
buildOptions: { | ||
...defaultBuildOptions, | ||
format: 'esm', | ||
}, | ||
}) | ||
|
||
// CJS build | ||
await build({ | ||
buildOptions: { | ||
...defaultBuildOptions, | ||
outdir: 'dist/cjs', | ||
}, | ||
}) | ||
|
||
// Place a package.json file with `type: commonjs` in the 'dist/cjs' folder so that | ||
// all files are considered CommonJS modules. | ||
writeFileSync('dist/cjs/package.json', JSON.stringify({ type: 'commonjs' })) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters