@@ -12,12 +12,13 @@ import json from '@rollup/plugin-json';
12
12
import nodePolyfills from 'rollup-plugin-polyfill-node' ;
13
13
import { nodeResolve } from '@rollup/plugin-node-resolve' ;
14
14
import postcss from 'rollup-plugin-postcss' ;
15
- import replace from 'rollup-plugin-re' ;
16
15
import { string } from 'rollup-plugin-string' ;
17
16
import svgo from 'rollup-plugin-svgo' ;
18
17
import webworkerLoader from 'rollup-plugin-web-worker-loader' ;
19
18
import copy from 'rollup-plugin-copy' ;
20
19
20
+ import packageJSON from './package.json' ;
21
+
21
22
import { rewriteFilenames } from './Utilities/rollup/plugin-rewrite-filenames' ;
22
23
23
24
const absolutifyImports = require ( './Utilities/build/absolutify-imports.js' ) ;
@@ -95,39 +96,8 @@ export default {
95
96
return name . replace ( / ^ S o u r c e s [ / \\ ] / , '' ) ;
96
97
} ,
97
98
} ,
98
- external : [ / @ b a b e l \/ r u n t i m e / ] ,
99
+ external : Object . keys ( packageJSON . dependencies ) . map ( ( name ) => new RegExp ( `^ ${ name } ` ) ) ,
99
100
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 : / ' u s e s t r i c t ' ; \n v a r u t i l s = r e q u i r e \( ' .\/ u t i l s ' \) ; / 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 : / C r c 3 2 P r o b e ' \) ; \n v a r D a t a L e n g t h P r o b e = r e q u i r e \( ' .\/ s t r e a m \/ D a t a L e n g t h P r o b e ' \) ; / m,
127
- replace : "Crc32Probe');\n" ,
128
- } ,
129
- ] ,
130
- } ) ,
131
101
alias ( {
132
102
entries : [
133
103
{ find : 'vtk.js' , replacement : path . resolve ( __dirname ) } ,
0 commit comments