Skip to content
This repository was archived by the owner on Oct 28, 2019. It is now read-only.

Commit 81ab155

Browse files
committed
🔧 Remove unused deps and all lib ships with ESM build
1 parent 6809d32 commit 81ab155

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

package-lock.json

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@types/nock": "^10.0.3",
5252
"@types/node": "^12.0.8",
5353
"@types/parse5": "^5.0.0",
54-
"cross-env": "^5.2.0",
5554
"jest": "^24.8.0",
5655
"lodash-es": "^4.17.11",
5756
"nock": "^10.0.6",

rollup.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ const multiBuild = allModules.reduce((p, n) => {
7878
experimentalOptimizeChunks: true,
7979
treeshake: { moduleSifeEffects: false },
8080
external: [
81-
'../lib/clone-deep.js',
82-
'../lib/parse5.js',
81+
'../lib/clone-deep',
82+
'../lib/parse5',
8383
'./deep-clone/index.js',
8484
'./fetch-as/index.js',
8585
'./lit-ntml/index.js',

rollup.config.lib.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const src = './src/lib';
3535
const allLibs = readdirSync(src).filter(n => /\.ts$/i.test(n));
3636

3737
const multiBuild = allLibs.reduce((p, n) => {
38-
p.push({
38+
const cjs = {
3939
input: `${src}/${n}`,
4040
output: {
4141
file: `dist/lib/${n.replace(/ts$/i, 'js')}`,
@@ -45,7 +45,17 @@ const multiBuild = allLibs.reduce((p, n) => {
4545
experimentalOptimizeChunks: true,
4646
plugins: pluginFn(),
4747
treeshake: { moduleSifeEffects: false },
48-
});
48+
};
49+
const esm = {
50+
...cjs,
51+
output: {
52+
...cjs.output,
53+
file: `dist/lib/${n.replace(/ts$/i, 'mjs')}`,
54+
format: 'esm',
55+
},
56+
};
57+
58+
p.push(cjs, esm);
4959

5060
return p;
5161
}, []);

src/deep-clone/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cloneDeep } from '../lib/clone-deep.js';
1+
import { cloneDeep } from '../lib/clone-deep';
22

33
export interface DeepCloneOptions {
44
absolute?: boolean;

src/lit-ntml/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parse, parseFragment, serialize } from '../lib/parse5.js';
1+
import { parse, parseFragment, serialize } from '../lib/parse5';
22

33
// export const DEFAULT_MINIFY_OPTIONS: htmlMinifier.Options = {
44
// collapseBooleanAttributes: true,

0 commit comments

Comments
 (0)