Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
Remove esm5 bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
surol committed Aug 13, 2019
1 parent 1b8b95d commit 71f5679
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 51 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
},
"main": "dist/a-iterable.js",
"module": "dist/a-iterable.mjs",
"esm5": "dist/a-iterable.esm5.js",
"typings": "index.d.ts",
"dependencies": {
"call-thru": "^2.5.2",
Expand Down
50 changes: 7 additions & 43 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,12 @@ import sourcemaps from 'rollup-plugin-sourcemaps';
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';

const mainConfig = makeConfig(
baseConfig('tsconfig.main.json'),
{
output: {
format: 'cjs',
file: pkg.main,
},
});

const esmConfig = makeConfig(
baseConfig('tsconfig.es6.json'),
{
output: {
file: pkg.module,
},
});

const esm5Config = makeConfig(
baseConfig('tsconfig.es5.json'),
{
output: {
file: pkg.esm5,
},
});

function makeConfig(baseConfig, ...configs) {
return configs.reduce(
(prev, config) => ({
...prev,
...config,
plugins: [ ...(prev.plugins || []), ...(config.plugins || []) ],
output: { ...(prev.output || {}), ...(config.output || {}) },
}),
baseConfig);
}
export default [
makeConfig({ tsconfig: 'tsconfig.module.json', file: pkg.module, format: 'esm' }),
makeConfig({ tsconfig: 'tsconfig.main.json', file: pkg.main, format: 'cjs' }),
];

function baseConfig(tsconfig) {
function makeConfig({ tsconfig, file, format }) {
return {
plugins: [
commonjs(),
Expand All @@ -56,14 +25,9 @@ function baseConfig(tsconfig) {
input: './src/index.ts',
external: Object.keys(pkg.dependencies),
output: {
format: 'esm',
file,
format,
sourcemap: true,
},
};
}

export default [
mainConfig,
esmConfig,
esm5Config,
]
7 changes: 0 additions & 7 deletions tsconfig.es5.json

This file was deleted.

File renamed without changes.

0 comments on commit 71f5679

Please sign in to comment.