Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Build library for the browser #1704

Closed
aratcliffe opened this issue Aug 4, 2022 · 1 comment
Closed

Build library for the browser #1704

aratcliffe opened this issue Aug 4, 2022 · 1 comment

Comments

@aratcliffe
Copy link

aratcliffe commented Aug 4, 2022

Hi, I have a library which consists of a single class which is the default export from src/index.js. I'd like the built library to be able to be included via a browser script tag. It builds successfully but what is exported is a module not a class, so in order to use the class I need to reference it as Clusterer.default instead of just Clusterer. This is what my neutrinorc.js looks like:

const library = require("@neutrinojs/library");

module.exports = {
  options: {
    root: __dirname
  },
  use: [
    library({
      name: "Clusterer",
      libraryTarget: "window",
      target: "web"
    }),
    (neutrino) => neutrino.config.externals(undefined)
  ]
};

I'm sure this is super easy to configure but I'm struggling to see how to do it!

@edmorley
Copy link
Member

edmorley commented Feb 3, 2024

Closing since unfortunately this project is no longer maintained. See:
#1707
neutrinojs/webpack-chain#358

@edmorley edmorley closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants