Skip to content

Commit 9e1784c

Browse files
committed
Do not minify common code.
1 parent bbde020 commit 9e1784c

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

packages/shared/common/rollup.config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import common from '@rollup/plugin-commonjs';
22
import json from '@rollup/plugin-json';
3-
import resolve from '@rollup/plugin-node-resolve';
4-
import terser from '@rollup/plugin-terser';
53
import typescript from '@rollup/plugin-typescript';
64
import { visualizer } from "rollup-plugin-visualizer";
75

86

7+
// The common library does not have a dependency resolution plugin as it should not have any
8+
// dependencies.
9+
10+
// This library is not minified as the final SDK package is responsible for minification.
11+
912
const getSharedConfig = (format, file) => ({
1013
input: 'src/index.ts',
1114
// Intermediate modules don't bundle all dependencies. We leave that to leaf-node
@@ -38,15 +41,13 @@ export default [
3841
transformMixedEsModules: true,
3942
esmExternals: true,
4043
}),
41-
// resolve(),
42-
terser(),
4344
json(),
4445
// The 'sourcemap' option allows using the minified size, not the size before minification.
4546
visualizer({ sourcemap: true }),
4647
],
4748
},
4849
{
4950
...getSharedConfig('cjs', 'dist/index.cjs.js'),
50-
plugins: [typescript({ tsconfig: './tsconfig.json' }), common(), resolve(), terser(), json()],
51+
plugins: [typescript({ tsconfig: './tsconfig.json' }), common(), json()],
5152
},
5253
];

packages/shared/sdk-client/rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import common from '@rollup/plugin-commonjs';
22
import json from '@rollup/plugin-json';
33
import resolve from '@rollup/plugin-node-resolve';
4-
import terser from '@rollup/plugin-terser';
54
import typescript from '@rollup/plugin-typescript';
65
import { visualizer } from "rollup-plugin-visualizer";
76

7+
// This library is not minified as the final SDK package is responsible for minification.
8+
89
const getSharedConfig = (format, file) => ({
910
input: 'src/index.ts',
1011
// Intermediate modules don't bundle all dependencies. We leave that to leaf-node
@@ -38,14 +39,13 @@ export default [
3839
esmExternals: true,
3940
}),
4041
resolve(),
41-
terser(),
4242
json(),
4343
// The 'sourcemap' option allows using the minified size, not the size before minification.
4444
visualizer({ sourcemap: true }),
4545
],
4646
},
4747
{
4848
...getSharedConfig('cjs', 'dist/index.cjs.js'),
49-
plugins: [typescript({ tsconfig: './tsconfig.json' }), common(), resolve(), terser(), json()],
49+
plugins: [typescript({ tsconfig: './tsconfig.json' }), common(), resolve(), json()],
5050
},
5151
];

0 commit comments

Comments
 (0)