Skip to content

Consider shipping fewer bundles #361

@43081j

Description

@43081j

fontkit/package.json

Lines 39 to 71 in fbf3b9e

"targets": {
"main": {
"source": "src/node.js",
"context": "browser",
"engines": {
"browsers": "chrome >= 70"
}
},
"node-module": {
"source": "src/node.js",
"isLibrary": true,
"includeNodeModules": false,
"engines": {
"browsers": "chrome >= 70"
}
},
"module": {
"source": "src/index.js",
"engines": {
"browsers": "chrome >= 70"
}
},
"browser": {
"source": "src/index.js",
"engines": {
"browsers": "chrome >= 70"
}
}
},
"files": [
"src",
"dist"
],

Currently the following is in the published npm package:

  • sources
  • ES module bundle
  • browser bundle
  • CommonJS bundle
  • browser CommonJS bundle

On top of this source maps exist for each bundle.

maybe im missing something, but it seems we're now at the point where these are equivalent:

  • ES module / browser
  • CommonJS / browser CommonJS

The sources probably don't need to be published, and the sourcemaps are likely unused too (who is debugging fontkit in their node modules?).

Can we greatly simplify this to where we either ship ESM-only, or at least only the ESM/CJS bundles and no sourcemaps?

The gain here would be faster installs, and smaller install size.

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