neutrinojs / neutrino

Create and build modern JavaScript projects with zero initial configuration.
https://neutrinojs.org
Mozilla Public License 2.0
3.95k stars 214 forks source link

Build library for the browser #1704

Closed aratcliffe closed 6 months ago

aratcliffe commented 2 years ago

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 commented 6 months ago

Closing since unfortunately this project is no longer maintained. See: https://github.com/neutrinojs/neutrino/issues/1707 https://github.com/neutrinojs/webpack-chain/issues/358