Skip to content

Commit bd00075

Browse files
committed
fix(esm): don't bundle externals
1 parent d48f295 commit bd00075

File tree

3 files changed

+7
-65
lines changed

3 files changed

+7
-65
lines changed

package-lock.json

Lines changed: 3 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"module": "./dist/esm/index.js",
3232
"dependencies": {
3333
"@babel/runtime": "7.15.4",
34+
"base64-js": "1.5.1",
3435
"blueimp-md5": "2.18.0",
3536
"commander": "8.2.0",
3637
"d3-scale": "4.0.0",
@@ -108,7 +109,6 @@
108109
"rollup-plugin-ignore": "1.0.10",
109110
"rollup-plugin-polyfill-node": "0.7.0",
110111
"rollup-plugin-postcss": "4.0.1",
111-
"rollup-plugin-re": "1.0.7",
112112
"rollup-plugin-string": "3.0.0",
113113
"rollup-plugin-svgo": "1.1.0",
114114
"rollup-plugin-web-worker-loader": "1.6.1",

rollup.config.js

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ import json from '@rollup/plugin-json';
1212
import nodePolyfills from 'rollup-plugin-polyfill-node';
1313
import { nodeResolve } from '@rollup/plugin-node-resolve';
1414
import postcss from 'rollup-plugin-postcss';
15-
import replace from 'rollup-plugin-re';
1615
import { string } from 'rollup-plugin-string';
1716
import svgo from 'rollup-plugin-svgo';
1817
import webworkerLoader from 'rollup-plugin-web-worker-loader';
1918
import copy from 'rollup-plugin-copy';
2019

20+
import packageJSON from './package.json';
21+
2122
import { rewriteFilenames } from './Utilities/rollup/plugin-rewrite-filenames';
2223

2324
const absolutifyImports = require('./Utilities/build/absolutify-imports.js');
@@ -95,39 +96,8 @@ export default {
9596
return name.replace(/^Sources[/\\]/, '');
9697
},
9798
},
98-
external: [/@babel\/runtime/],
99+
external: Object.keys(packageJSON.dependencies).map((name) => new RegExp(`^${name}`)),
99100
plugins: [
100-
// should be before commonjs
101-
replace({
102-
patterns: [
103-
{
104-
// match against jszip/lib/load.js
105-
// Workaround until https://github.com/Stuk/jszip/pull/731 is merged
106-
include: path.resolve(
107-
__dirname,
108-
'node_modules',
109-
'jszip',
110-
'lib',
111-
'load.js'
112-
),
113-
test: /'use strict';\nvar utils = require\('.\/utils'\);/m,
114-
replace: "'use strict'",
115-
},
116-
{
117-
// match against jszip/lib/compressedObject.js
118-
// Workaround until https://github.com/Stuk/jszip/pull/731 is merged
119-
include: path.resolve(
120-
__dirname,
121-
'node_modules',
122-
'jszip',
123-
'lib',
124-
'compressedObject.js'
125-
),
126-
test: /Crc32Probe'\);\nvar DataLengthProbe = require\('.\/stream\/DataLengthProbe'\);/m,
127-
replace: "Crc32Probe');\n",
128-
},
129-
],
130-
}),
131101
alias({
132102
entries: [
133103
{ find: 'vtk.js', replacement: path.resolve(__dirname) },

0 commit comments

Comments
 (0)