Skip to content

Importmap help #258

Description

@SmDeltArt

Request for importmap support in web-ifc-viewer

Hi there 👋,

I’m working on the AIfc-Manager-Attribute project and trying to use web-ifc-viewer in a plain HTML demo (no bundler), just via an <script type="importmap"> and native ESM imports. My goal is a minimal “upload IFC file” example. Right now I get “module not found” errors for web-ifc-viewer, web-ifc-three, and three. For example:

<script type="importmap">
{
  "imports": {
    "three": "./node_modules/three/build/three.module.js",
    "web-ifc-three": "./node_modules/web-ifc-viewer/dist/web-ifc-three.module.js",
    "web-ifc-viewer": "./node_modules/web-ifc-viewer/dist/index.js"
  }
}
</script>

<script type="module">
  import { IfcViewerAPI } from 'web-ifc-viewer';
  // …
</script>

I’ve also tried copying the files from node_modules/web-ifc-viewer/dist into my public folder and updating paths, but the browser still complains. Could you please share the correct ESM entry points (or CDN URLs) and/or an example import-map configuration that works? I’d love to stay bundler-free for this attribute-viewer demo.

Thanks for any guidance!
—Benoît
cad-ai-support.blog

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions