Skip to content

floryst/vtk-js-angular-10

Repository files navigation

vtk.js + Angular 10

This project was generated with Angular CLI version 10.0.6.

Setting up build env starting from a blank Angular 10 template:

  1. yarn add vtk.js
  2. yarn add -D shader-loader worker-loader
  3. yarn add -D @angular-builders/custom-webpack
  4. Edit angular.json:
  • Replace @angular-devkit/build-angular:browser with @angular-builders/custom-webpack:browser
  • Replace @angular-devkit/build-angular:dev-server with @angular-builders/custom-webpack:dev-server
  • Add an option under your app project (subkey architect.build.options):
    "optionss": {
      "customWebpackConfig": {
        "path": "./webpack.config.js"
      }
      ...
    }
    
  1. Add the following webpack.config.js:
const webpack = require('webpack');
const vtkRules = require('vtk.js/Utilities/config/dependency').webpack;

module.exports = {
  module: {
    rules: vtkRules.core.rules,
  },
};
  1. Edit index.html:
<script type="text/javascript">
  // vtk.js macro.js refers to globa
  var global = window || global;
</script>

About

Example repo demonstrating vtk.js and Angular 10

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published