Skip to content

Bundling Pannellum see request from unpkg.com #192

Closed
@andrewspy

Description

@andrewspy

🐛 The bug

Pannellum.js still served from unpkg.com despite setting bundle to true with the following code:

<script lang="ts" setup>
const { $script } = useScriptNpm({
  packageName: 'pannellum',
  file: 'build/pannellum.js',
  version: '2.5.6',
  scriptOptions: {
    bundle: true,
    use() {
      // @ts-ignore
      return { pannellum: window.pannellum };
    },
  },
});

onMounted(() => {
  $script.then(({ pannellum }) => {
    // do something
  });
});
</script>

unpkg.com link: https://unpkg.com/[email protected]/build/pannellum.js

To build and preview:

npm run build
npm run preview

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-scrript-pannellum-bundle?file=app.vue

🌈 Expected behavior

Pannellum.js should be served from the bundle after the build.

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions