Slide 83
Slide 83 text
Core Packages
1. Consumer Application should be able to include the default and named imports in
the application.
import api, { get, post } from 'api'
module: "dist/index.mjs" // ---> The module field in package.json
2. if the consumer application use legacy bundling tools, the author should add
support for CJS module system as well.
import api, { get, post } from 'api'
main: "dist/index.js" // ---> The main field in package.json
3. Consumer application should be able to directly consume the package i.e 'ui-kit' with
i.e no tree shaking, no side effects in the browser.
import api, { get, post } from “https://unpkg.com/api/dist/index.mjs”
import api, { get, post } from “https://unpkg.com/api/dist/index.js”