Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove data-connect es5 bundles #8537

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading