Skip to content

Commit

Permalink
ENG-0000 - Added commonjs variants
Browse files Browse the repository at this point in the history
Because jest chokes on esm and nothing is every really easy
  • Loading branch information
mcnielsen committed May 3, 2023
1 parent 8113639 commit 85e2d75
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@al/core",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"description": "Node Enterprise Packages for Alert Logic (NEPAL) Core Library",
"main": "./bundles/al-core-nucleus.esm2015.js",
"main": "./bundles/al-core-nucleus.es5.js",
"types": "./types/al-core-nucleus.d.ts",
"module": "./bundles/al-core-nucleus.esm2015.js",
"author": {
Expand Down
5 changes: 5 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function configureEntryPoint( bundleName, directory ) {
file: `bundles/al-core-${bundleName}.esm2015.js`,
format: 'esm', // Keep the bundle as an ES module file
sourcemap: true,
},
{
file: `bundles/al-core-${bundleName}.es5.js`,
format: 'cjs', // Keep the bundle as a common JS module file
sourcemap: true,
}
],
external,
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildEntryPointPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function buildPackage( entryPoint:string ) {
if ( entryPoint !== 'nucleus' ) {
const packageJson = {
name: `@al/core/${entryPoint}`,
main: `../bundles/al-core-${entryPoint}.esm2015.js`,
main: `../bundles/al-core-${entryPoint}.es5.js`,
module: `../bundles/al-core-${entryPoint}.esm2015.js`,
typings: `../types/al-core-${entryPoint}.d.ts`
};
Expand Down

0 comments on commit 85e2d75

Please sign in to comment.