I found a solution here . You do not need to fetch, since Angular 6 has disabled the outlier. Just follow the article and the content of extra-webpack.config.js as follows:
module.exports = { module: { rules: [ { test: /\.glsl$/i, include: /node_modules(\/|\\)vtk\.js(\/|\\)/, loader: 'shader-loader', }, { test: /\.js$/, include: /node_modules(\/|\\)vtk\.js(\/|\\)/, loader: 'babel-loader?presets[]=env', }, { test: /\.worker\.js$/, include: /node_modules(\/|\\)vtk\.js(\/|\\)/, use: [ { loader: 'worker-loader', options: { inline: true, fallback: false }, }, ], }, ], }, };
Of course, you should install the vtk.js and kw-web-suit dependencies. Then it must be successfully compiled. if you encounter an error that says "global is not defined" in browser developer mode, then add (window as any).global = window; Corner polyfills.ts . It works for me on Angular 6 with the latest vtk.js.
Allen lu
source share