Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit 03d8a35

Browse files
committed
Remove esm5 bundle
1 parent c0240df commit 03d8a35

File tree

4 files changed

+7
-51
lines changed

4 files changed

+7
-51
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
},
1818
"main": "dist/context-values.js",
1919
"module": "dist/context-values.mjs",
20-
"esm5": "dist/context-values.esm5.js",
2120
"typings": "index.d.ts",
2221
"dependencies": {
2322
"a-iterable": "^2.4.2",

rollup.config.js

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,12 @@ import sourcemaps from 'rollup-plugin-sourcemaps';
44
import typescript from 'rollup-plugin-typescript2';
55
import pkg from './package.json';
66

7-
const mainConfig = makeConfig(
8-
baseConfig('tsconfig.main.json'),
9-
{
10-
output: {
11-
format: 'cjs',
12-
file: pkg.main,
13-
},
14-
});
15-
16-
const esmConfig = makeConfig(
17-
baseConfig('tsconfig.es6.json'),
18-
{
19-
output: {
20-
file: pkg.module,
21-
},
22-
});
23-
24-
const esm5Config = makeConfig(
25-
baseConfig('tsconfig.es5.json'),
26-
{
27-
output: {
28-
file: pkg.esm5,
29-
},
30-
});
31-
32-
function makeConfig(baseConfig, ...configs) {
33-
return configs.reduce(
34-
(prev, config) => ({
35-
...prev,
36-
...config,
37-
plugins: [ ...(prev.plugins || []), ...(config.plugins || []) ],
38-
output: { ...(prev.output || {}), ...(config.output || {}) },
39-
}),
40-
baseConfig);
41-
}
7+
export default [
8+
makeConfig({ tsconfig: 'tsconfig.module.json', file: pkg.module, format: 'esm' }),
9+
makeConfig({ tsconfig: 'tsconfig.main.json', file: pkg.main, format: 'cjs' }),
10+
];
4211

43-
function baseConfig(tsconfig) {
12+
function makeConfig({ tsconfig, file, format }) {
4413
return {
4514
plugins: [
4615
commonjs(),
@@ -56,14 +25,9 @@ function baseConfig(tsconfig) {
5625
input: './src/index.ts',
5726
external: Object.keys(pkg.dependencies),
5827
output: {
59-
format: 'esm',
28+
file,
29+
format,
6030
sourcemap: true,
6131
},
6232
};
6333
}
64-
65-
export default [
66-
mainConfig,
67-
esmConfig,
68-
esm5Config,
69-
]

tsconfig.es5.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)