-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(esm/cjs): Make dbauth middleware a dual package (#10948)
Co-authored-by: GitHub Actions <>
- Loading branch information
Showing
11 changed files
with
97 additions
and
55 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,35 @@ | ||
import { build } from '@redwoodjs/framework-tools' | ||
import { | ||
build, | ||
defaultBuildOptions, | ||
} from '@redwoodjs/framework-tools' | ||
|
||
await build() | ||
import { generateCjsTypes} from '@redwoodjs/framework-tools/cjsTypes' | ||
import { writeFileSync } from 'node:fs' | ||
|
||
// CJS build | ||
await build({ | ||
buildOptions: { | ||
...defaultBuildOptions, | ||
outdir: 'dist/cjs', | ||
packages: 'external', | ||
}, | ||
}) | ||
|
||
// ESM build | ||
await build({ | ||
buildOptions: { | ||
...defaultBuildOptions, | ||
format: 'esm', | ||
packages: 'external', | ||
}, | ||
}) | ||
|
||
// Place a package.json file with `type: commonjs` in the dist/cjs folder so that | ||
// all .js files are treated as CommonJS files. | ||
writeFileSync('dist/cjs/package.json', JSON.stringify({ type: 'commonjs' })) | ||
|
||
// Place a package.json file with `type: module` in the dist folder so that | ||
// all .js files are treated as ES Module files. | ||
writeFileSync('dist/package.json', JSON.stringify({ type: 'module' })) | ||
|
||
await generateCjsTypes() |
4 changes: 0 additions & 4 deletions
4
packages/auth-providers/dbAuth/middleware/cjsWrappers/plugin.js
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
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
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
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
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