Using Pre-Built Modules
Add the library as a dependency to your project
npm install opencascade.js@betaConfigure your bundler to load
.wasmfiles 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-loaderdependency.npm install file-loader --save-devThen 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!
});