is-what icon indicating copy to clipboard operation
is-what copied to clipboard

Expose individual files as exported files

Open jcbhmr opened this issue 2 years ago • 1 comments

Basically add this to package.json

{
  "exports": {
    ".": "./dist/index.js",
    // In addition to ☝
    "./*.js": "./dist/*.js"
  }
}

to allow:

import { isObject } from "is-what/isObject.js"

or if we used default exports

import isObject from "is-what/isObject.js"

this is in the spirit of keeping the package as light as possible. This way, even if your target environment doesn't do bundling/tree-shaking, you can still manually "treeshake" in your code to only import what's needed.

cc @mesqueeb is this a good idea?

jcbhmr avatar Jul 16 '23 02:07 jcbhmr

This is actually one of the reasons I wanted #57 😅

jcbhmr avatar Jul 17 '23 21:07 jcbhmr