Skip to content

Commit

Permalink
Remove data-connect es5 bundles (#8537)
Browse files Browse the repository at this point in the history
* Remove data-connect es5 bundles

* Formatting
  • Loading branch information
dlarocque authored Oct 16, 2024
1 parent cf988b0 commit 8fb044e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 49 deletions.
4 changes: 1 addition & 3 deletions packages/data-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
"main": "dist/index.node.cjs.js",
"browser": "dist/index.esm2017.js",
"module": "dist/index.esm2017.js",
"esm5": "dist/index.esm5.js",
"exports": {
".": {
"types": "./dist/public.d.ts",
"node": {
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"browser": {
"require": "./dist/index.cjs.js",
"import": "./dist/index.esm2017.js"
Expand Down Expand Up @@ -77,4 +75,4 @@
],
"reportDir": "./coverage/node"
}
}
}
62 changes: 16 additions & 46 deletions packages/data-connect/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,47 +35,15 @@ function onWarn(warning, defaultWarn) {
defaultWarn(warning);
}

const es5BuildPlugins = [
const buildPlugins = [
typescriptPlugin({
typescript,
abortOnError: false
}),
json()
];

const es2017BuildPlugins = [
typescriptPlugin({
typescript,
tsconfigOverride: {
compilerOptions: {
target: 'es2017'
}
},
abortOnError: false
}),
json({ preferConst: true })
];

const browserBuilds = [
{
input: 'src/index.ts',
output: [
{
file: pkg.esm5,
format: 'es',
sourcemap: true
}
],
plugins: [
...es5BuildPlugins,
replace(generateBuildTargetReplaceConfig('esm', 5))
],
treeshake: {
moduleSideEffects: false
},
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
onwarn: onWarn
},
{
input: 'src/index.ts',
output: [
Expand All @@ -86,7 +54,7 @@ const browserBuilds = [
}
],
plugins: [
...es2017BuildPlugins,
...buildPlugins,
replace(generateBuildTargetReplaceConfig('esm', 2017))
],
treeshake: {
Expand All @@ -97,15 +65,13 @@ const browserBuilds = [
},
{
input: 'src/index.ts',
output: [
{
file: 'dist/index.cjs.js',
format: 'cjs',
sourcemap: true
}
],
output: {
file: pkg.exports['.'].browser.require,
format: 'cjs',
sourcemap: true
},
plugins: [
...es2017BuildPlugins,
...buildPlugins,
replace(generateBuildTargetReplaceConfig('cjs', 2017))
],
treeshake: {
Expand All @@ -119,10 +85,14 @@ const browserBuilds = [
const nodeBuilds = [
{
input: 'src/index.node.ts',
output: { file: pkg.main, format: 'cjs', sourcemap: true },
output: {
file: pkg.main,
format: 'cjs',
sourcemap: true
},
plugins: [
...es5BuildPlugins,
replace(generateBuildTargetReplaceConfig('cjs', 5))
...buildPlugins,
replace(generateBuildTargetReplaceConfig('cjs', 2017))
],
treeshake: {
moduleSideEffects: false
Expand All @@ -138,7 +108,7 @@ const nodeBuilds = [
sourcemap: true
},
plugins: [
...es2017BuildPlugins,
...buildPlugins,
replace(generateBuildTargetReplaceConfig('esm', 2017)),
emitModulePackageFile()
],
Expand Down

0 comments on commit 8fb044e

Please sign in to comment.