From 27b1de81952ffb2c349dbee44bc031351514c055 Mon Sep 17 00:00:00 2001 From: Forrest Li Date: Thu, 12 Aug 2021 18:55:34 -0400 Subject: [PATCH] fix(rollup): Do not bundle vtk.js In reference to #28, we should not bundle `@kitware/vtk.js`. Additionally, this directly impacts `vtkMapper`, as setting global/static coincident topology parameters is done at a module level, and bundling vtk.js with react-vtk-js means it's impossible to set global parameters for react-vtk-js. This will mean all consumers must install `@kitware/vtk.js` alongside react-vtk-js. Should this be a breaking change, or are we okay having people realize this once npm/yarn complains about missing peer deps? --- rollup.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 467414d..9453d5c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -25,7 +25,10 @@ export default { format: 'cjs', }, ], - external: ['react', 'prop-types'], + external: (id) => ( + ['react', 'prop-types'].indexOf(id) > 0 || + /^@kitware\/vtk\.js/.test(id) + ), plugins: [ nodeResolve({ // include: 'node_modules/**',