Using Pre-Built Modules
Add the library as a dependency to your project
npm install opencascade.js@beta
Configure your bundler to load
.wasm
files as URLs. If you don't want to use a bundler, you can manually pass in the URLs to the WASM files in the next step.For webpack, first add the
file-loader
dependency.npm install file-loader --save-dev
Then add the following configuration to your
webpack.config.js
.module: {
rules: [
{
test: /\.wasm$/,
type: "javascript/auto",
loader: "file-loader"
}
]
},
node: {
fs: "empty"
}In your JavaScript file, instantiate the library:
import initOpenCascade from "opencascade.js";
initOpenCascade().then(oc => {
// Check out the examples on how to use this library!
});