Skip to content

Commit ab47f69

Browse files
committed
fix: do not bundle vtk.js
The externals key is wrong, and so a lot of external dependencies were being brought into the build output (e.g. vtk.js, react/jsx-runtime, etc.) This fixes the geometry representation mapper.modified() hack, which was needed when testing the Algorithm component in `usage` because there were two different globalMTime variables: one in the macros.js in dist/node_modules/@kitware/vtk.js, and another one in the usage/node_modules/... dir.
1 parent a601550 commit ab47f69

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"deploy": "gh-pages -d usage/dist -f -r $GIT_PUBLISH_URL",
2626
"commit": "git cz",
2727
"semantic-release": "semantic-release",
28-
"dev": "rollup ./src/index.js -c --watch"
28+
"dev": "rollup -c --watch"
2929
},
3030
"peerDependencies": {
3131
"@kitware/vtk.js": "^26.5.3",

rollup.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import commonjs from '@rollup/plugin-commonjs';
21
import { babel } from '@rollup/plugin-babel';
2+
import commonjs from '@rollup/plugin-commonjs';
33
import eslint from '@rollup/plugin-eslint';
4-
import { terser } from 'rollup-plugin-terser';
5-
import analyze from 'rollup-plugin-analyzer';
64
import { nodeResolve } from '@rollup/plugin-node-resolve';
5+
import analyze from 'rollup-plugin-analyzer';
6+
import { terser } from 'rollup-plugin-terser';
77

88
const plugins = [
99
!process.env.NOLINT &&
@@ -80,15 +80,15 @@ export default [
8080
input: 'src/index.ts',
8181
output: {
8282
dir: 'dist/ts',
83-
format: 'esm',
83+
format: 'es',
8484
preserveModules: true,
8585
preserveModulesRoot: 'src',
8686
},
8787
external: [
88-
'@babel/runtime',
89-
'@kitware/vtk.js',
90-
'prop-types',
88+
/^@babel\/runtime\/?/,
89+
/^@kitware\/vtk\.js/,
9190
'react',
91+
'react/jsx-runtime',
9292
'regenerator-runtime',
9393
],
9494
plugins: [

src/core-ts/GeometryRepresentation.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,6 @@ export default forwardRef(function GeometryRepresentation(
359359
getActor,
360360
getMapper,
361361
dataChanged: () => {
362-
// TODO when algorithm updates, need to update mapper?
363-
getMapper().modified();
364362
view.requestRender();
365363
},
366364
dataAvailable: () => {

0 commit comments

Comments
 (0)