craco-vtk

1.0.2 • Public • Published

craco-vtk

Let's use vtk.js with create-react-app today!

This is a plugin for @craco/craco.

3D React Logo

Try it!  try it

Usage

1. Create a React project

npx create-react-app example
cd example

2. Install modules

In your create-react-app project, install modules:

npm install --save @craco/craco craco-vtk vtk.js shader-loader worker-loader css-loader style-loader postcss-loader
# or
yarn add @craco/craco craco-vtk vtk.js shader-loader worker-loader css-loader style-loader postcss-loader

3. Rewrite npm scripts

Rewrite npm scripts in package.json as following:

{
  // ...
  "scripts": {
    "start": "craco start", // react-scripts -> craco
    "build": "craco build", // react-scripts -> craco
    "test": "craco test",   // react-scripts -> craco
    "eject": "react-scripts eject"
  },
  // ...
}

4. Create craco config file

Create craco.config.js in the proejct root:

const CracoVtkPlugin = require("craco-vtk");

module.exports = {
  plugins: [
    {
      plugin: CracoVtkPlugin()
    }
  ]
};

5. Congratulations! 🎉

Setup is complete! Enjoy your VTK life.🏝

Acknowledgements

This package was inspired by craco-cesium.

See also craco-itk.

Readme

Keywords

none

Package Sidebar

Install

npm i craco-vtk

Weekly Downloads

38

Version

1.0.2

License

Apache-2.0

Unpacked Size

14.1 kB

Total Files

4

Last publish

Collaborators

  • thewtex