-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transpile ESM-only packages to CJS for compatibility with CJS environ…
…ments.
- Loading branch information
Showing
7 changed files
with
160 additions
and
79 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { getBaseRollupConfig } from '../../helpers/getBaseRollupConfig'; | ||
import pkg from './package.json'; | ||
|
||
export default getBaseRollupConfig('./tsconfig.rollup.json', (options) => ({ | ||
...options, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
})); | ||
export default getBaseRollupConfig( | ||
'./tsconfig.rollup.json', | ||
(esmOptions) => ({ | ||
...esmOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
}), | ||
(cjsOptions) => ({ | ||
...cjsOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
], | ||
}) | ||
); |
37 changes: 23 additions & 14 deletions
37
packages/gatsby-remark-code-snippet-remover/rollup.config.js
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,17 +1,26 @@ | ||
import { getBaseRollupConfig } from '../../helpers/getBaseRollupConfig'; | ||
import pkg from './package.json'; | ||
|
||
export default getBaseRollupConfig('./tsconfig.rollup.json', (options) => ({ | ||
...options, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
})); | ||
export default getBaseRollupConfig( | ||
'./tsconfig.rollup.json', | ||
(esmOptions) => ({ | ||
...esmOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
}), | ||
(cjsOptions) => ({ | ||
...cjsOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
], | ||
}) | ||
); |
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,17 +1,26 @@ | ||
import { getBaseRollupConfig } from '../../helpers/getBaseRollupConfig'; | ||
import pkg from './package.json'; | ||
|
||
export default getBaseRollupConfig('./tsconfig.rollup.json', (options) => ({ | ||
...options, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
})); | ||
export default getBaseRollupConfig( | ||
'./tsconfig.rollup.json', | ||
(esmOptions) => ({ | ||
...esmOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
}), | ||
(cjsOptions) => ({ | ||
...cjsOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
], | ||
}) | ||
); |
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,17 +1,26 @@ | ||
import { getBaseRollupConfig } from '../../helpers/getBaseRollupConfig'; | ||
import pkg from './package.json'; | ||
|
||
export default getBaseRollupConfig('./tsconfig.rollup.json', (options) => ({ | ||
...options, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
})); | ||
export default getBaseRollupConfig( | ||
'./tsconfig.rollup.json', | ||
(esmOptions) => ({ | ||
...esmOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
}), | ||
(cjsOptions) => ({ | ||
...cjsOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
], | ||
}) | ||
); |
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,17 +1,26 @@ | ||
import { getBaseRollupConfig } from '../../helpers/getBaseRollupConfig'; | ||
import pkg from './package.json'; | ||
|
||
export default getBaseRollupConfig('./tsconfig.rollup.json', (options) => ({ | ||
...options, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
})); | ||
export default getBaseRollupConfig( | ||
'./tsconfig.rollup.json', | ||
(esmOptions) => ({ | ||
...esmOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
}, | ||
], | ||
}), | ||
(cjsOptions) => ({ | ||
...cjsOptions, | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
}, | ||
], | ||
}) | ||
); |