Repository: developit/microbundle Branch: master Commit: 9f56e06b0d1d Files: 233 Total size: 265.4 KB Directory structure: gitextract_yce_p9ai/ ├── .changeset/ │ ├── README.md │ ├── config.json │ ├── gold-berries-march.md │ ├── swift-plums-fix.md │ └── violet-falcons-dream.md ├── .editorconfig ├── .eslintrc ├── .github/ │ └── workflows/ │ ├── nodejs.yml │ ├── release.yml │ └── size.yml ├── .gitignore ├── .prettierignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── babel.config.js ├── index.d.ts ├── package.json ├── src/ │ ├── cli.js │ ├── index.js │ ├── lib/ │ │ ├── __entry__.js │ │ ├── babel-custom.js │ │ ├── compressed-size.js │ │ ├── css-modules.js │ │ ├── option-normalization.js │ │ ├── package-info.js │ │ ├── terser.js │ │ └── transform-fast-rest.js │ ├── log-error.js │ ├── prog.js │ └── utils.js ├── test/ │ ├── __snapshots__/ │ │ └── index.test.js.snap │ ├── fixtures/ │ │ ├── alias/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── constants-debug.js │ │ │ ├── constants.js │ │ │ └── index.js │ │ ├── alias-external/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── colossal-glob.js │ │ │ └── index.js │ │ ├── async-iife-ts/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── async-ts/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── basic/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── basic-babelrc/ │ │ │ ├── .babelrc │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── basic-compress-false/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── basic-css/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.css │ │ ├── basic-dashed-external/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── basic-flow/ │ │ │ ├── .flowconfig │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── fruits.js │ │ │ └── index.js │ │ ├── basic-json/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.json │ │ ├── basic-multi-source/ │ │ │ ├── a.js │ │ │ ├── b.js │ │ │ └── package.json │ │ ├── basic-multi-source-css/ │ │ │ ├── a.css │ │ │ ├── a.js │ │ │ ├── b.css │ │ │ ├── b.js │ │ │ └── package.json │ │ ├── basic-no-compress/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── basic-no-pkg-main/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── basic-node-internals/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── basic-ts/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── car.ts │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── basic-tsx/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.tsx │ │ │ └── tsconfig.json │ │ ├── basic-with-cwd/ │ │ │ ├── basic/ │ │ │ │ ├── package.json │ │ │ │ └── src/ │ │ │ │ ├── index.js │ │ │ │ └── two.js │ │ │ └── package.json │ │ ├── class-decorators-ts/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── class-properties/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── css-modules--false/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ ├── not_scoped.css │ │ │ └── not_scoped.module.css │ │ ├── css-modules--null/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ ├── not_scoped.css │ │ │ └── scoped.module.css │ │ ├── css-modules--string/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ ├── scoped.css │ │ │ └── scoped.module.css │ │ ├── css-modules--true/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ ├── scoped.css │ │ │ └── scoped.module.css │ │ ├── custom-babelrc/ │ │ │ ├── .babelrc │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── custom-outputs/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── custom-outputs-alt/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── custom-source/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── custom-source.js │ │ │ └── two.js │ │ ├── custom-source-with-cwd/ │ │ │ ├── custom-source/ │ │ │ │ ├── package.json │ │ │ │ └── src/ │ │ │ │ ├── custom-source.js │ │ │ │ └── two.js │ │ │ └── package.json │ │ ├── default-named/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── define/ │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── define-expression/ │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── esnext-ts/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── inline-source-map/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── jsx/ │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── macro/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── macro.js │ │ ├── mangle-json-file/ │ │ │ ├── mangle.json │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── minify-config/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── minify-config-boolean/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── minify-path-config/ │ │ │ ├── minify.json │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── minify-path-parent-dir-with-cwd/ │ │ │ ├── minify-path-parent-dir/ │ │ │ │ ├── index.js │ │ │ │ ├── package.json │ │ │ │ └── two.js │ │ │ ├── minify.json │ │ │ └── package.json │ │ ├── modern/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── modern-generators/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── name-custom-amd/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── name-custom-cli/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── no-pkg/ │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── no-pkg-name/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ ├── index.js │ │ │ └── two.js │ │ ├── optional-chaining-ts/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── parameters-rest-closure/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── pretty/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── publish-config/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── foo.ts │ │ ├── pure/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── raw/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── shebang/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── terser-annotations/ │ │ │ ├── mangle.json │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ ├── ts-custom-declaration/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.ts │ │ │ ├── tsconfig.json │ │ │ └── types/ │ │ │ └── index.d.ts │ │ ├── ts-declaration/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.tsx │ │ │ ├── tsconfig.json │ │ │ └── types/ │ │ │ └── index.d.ts │ │ ├── ts-jsx/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.tsx │ │ │ └── tsconfig.json │ │ ├── ts-mixed-exports/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── car.ts │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── ts-module/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── foo.ts │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── visualizer/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── index.js │ │ └── worker-loader/ │ │ ├── package.json │ │ └── src/ │ │ ├── bar.js │ │ ├── index.js │ │ └── worker.js │ ├── index.test.js │ └── lib/ │ └── util.js ├── tools/ │ ├── build-fixture.js │ └── generate-filesize.js └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .changeset/README.md ================================================ # Changesets Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets) We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md) ================================================ FILE: .changeset/config.json ================================================ { "$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json", "changelog": [ "@changesets/changelog-github", { "repo": "developit/microbundle" } ], "commit": false, "linked": [], "access": "public", "baseBranch": "master", "updateInternalDependencies": "patch", "ignore": [] } ================================================ FILE: .changeset/gold-berries-march.md ================================================ --- 'microbundle': patch --- Fix indentation style in `mangle.json` not preserved ================================================ FILE: .changeset/swift-plums-fix.md ================================================ --- 'microbundle': patch --- Silence Rollup's noisy (and usually harmless) `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten.` warnings ================================================ FILE: .changeset/violet-falcons-dream.md ================================================ --- 'microbundle': patch --- Fixes positioning bug with UMD sourcemaps ================================================ FILE: .editorconfig ================================================ root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,.*rc,*.yml}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false ================================================ FILE: .eslintrc ================================================ { "extends": [ "eslint-config-developit", "prettier", "plugin:prettier/recommended" ], "plugins": [ "prettier" ], "rules": { "brace-style": "off", "comma-dangle": ["warn", "always-multiline"], "indent": "off", "require-atomic-updates": "off" }, "settings": { "react": { "version": "16.6" } }, "ignorePatterns": [ "dist" ] } ================================================ FILE: .github/workflows/nodejs.yml ================================================ name: Node CI on: pull_request: {} push: branches: - master jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [12.x, 14.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm - run: npm ci --ignore-scripts - name: npm build and test run: npm test ================================================ FILE: .github/workflows/release.yml ================================================ name: Release on: push: branches: - master jobs: release: name: Release runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v4 with: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - name: Setup Node.js 22.x uses: actions/setup-node@v4 with: node-version: 22.x - name: Install Dependencies run: npm install - name: Create Release Pull Request or Publish to npm id: changesets uses: changesets/action@master with: # This expects you to have a script called release which does a build for your packages and calls changeset publish publish: npm run release env: GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} ================================================ FILE: .github/workflows/size.yml ================================================ name: compressed-size on: pull_request: branches: - master jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: compressed-size-action uses: preactjs/compressed-size-action@v2 with: pattern: 'dist/!(*.js.map)' build-script: build repo-token: '${{ secrets.GITHUB_TOKEN }}' - name: compressed-size-action uses: preactjs/compressed-size-action@v2 with: pattern: 'test/fixtures/**/dist/!(*.map)' # We're using this to report size differences, not test, so update snapshots if they fail. # The CI can catch the test failures instead. build-script: 'test -- -u' repo-token: '${{ secrets.GITHUB_TOKEN }}' ================================================ FILE: .gitignore ================================================ node_modules .DS_Store *.log .rpt2_cache .rts2_cache_cjs .rts2_cache_es .rts2_cache_umd build dist yarn.lock .vscode .idea .rts2* sizes.csv test/fixtures/visualizer/stats.html ================================================ FILE: .prettierignore ================================================ dist/ ================================================ FILE: CHANGELOG.md ================================================ # microbundle ## 0.15.1 ### Patch Changes - [`cebafa1`](https://github.com/developit/microbundle/commit/cebafa121953a771f010b3cfd250a83bfc754e2c) [#961](https://github.com/developit/microbundle/pull/961) Thanks [@zyrong](https://github.com/zyrong)! - Fix for when multiple entries reference different CSS, only the CSS referenced by the first entry will be packaged * [`9a4e2b2`](https://github.com/developit/microbundle/commit/9a4e2b2096d3824661738edb142b4658cf3d9d0b) [#954](https://github.com/developit/microbundle/pull/954) Thanks [@rschristian](https://github.com/rschristian)! - Bumps Node target to v12 - [`4ad4b76`](https://github.com/developit/microbundle/commit/4ad4b768f0ef6f434b753c4a42cdcfe85d01c404) [#967](https://github.com/developit/microbundle/pull/967) Thanks [@agilgur5](https://github.com/agilgur5)! - deps: upgrade rpt2 to latest v0.32.0 to fix monorepos * [`6018e58`](https://github.com/developit/microbundle/commit/6018e586b91125233026ca977a97b72bb6082ec6) [#956](https://github.com/developit/microbundle/pull/956) Thanks [@rschristian](https://github.com/rschristian)! - Silences warnings when using Node builtins with the 'node:...' protocol on imports. Warnings related to bare usage of these builtins were already silenced. - [`88241dd`](https://github.com/developit/microbundle/commit/88241ddf8fc3ac18cfc1ca8ced99a413f8d2b488) [#968](https://github.com/developit/microbundle/pull/968) Thanks [@PeterBurner](https://github.com/PeterBurner)! - deps: upgrade babel-plugin-transform-async-to-promises to latest v0.8.18 to fix #565 * [`e72377a`](https://github.com/developit/microbundle/commit/e72377a001cc5925ff25aadbe26fdb96a0dab3a4) [#964](https://github.com/developit/microbundle/pull/964) Thanks [@rschristian](https://github.com/rschristian)! - Fixes filename generation for es & modern outputs. Both 'jsnext:main' and 'esmodule' were incorrectly ignored. ## 0.15.0 ### Minor Changes - [`6f6e080`](https://github.com/developit/microbundle/commit/6f6e080f3b9ec9a223d79d24eb6e6c8dd5d72cf7) [#950](https://github.com/developit/microbundle/pull/950) Thanks [@rschristian](https://github.com/rschristian)! - Microbundle will now output ESM using `.mjs` as the file extension when the package type is CJS * [`242754f`](https://github.com/developit/microbundle/commit/242754f43cce1c25a6c475be64bbd2a525eb7cf0) [#949](https://github.com/developit/microbundle/pull/949) Thanks [@rschristian](https://github.com/rschristian)! - Add --visualize flag to generate build output stats ### Patch Changes - [`c4532cc`](https://github.com/developit/microbundle/commit/c4532cc9ccd846e6bc8176414ddf2c0fc22af1f1) [#940](https://github.com/developit/microbundle/pull/940) Thanks [@rschristian](https://github.com/rschristian)! - Adds information about `--compress` flag's default value w/ different targets * [`b51b855`](https://github.com/developit/microbundle/commit/b51b855794866f3e6a0ef7dfc5672d5c1c717831) [#935](https://github.com/developit/microbundle/pull/935) Thanks [@mycoin](https://github.com/mycoin)! - Don't attempt to write build stats in watch mode when there has been a build error/sizeInfo is `undefined` - [`1d0e305`](https://github.com/developit/microbundle/commit/1d0e305d89ad010793c57fc451991a79907e1f3f) [#941](https://github.com/developit/microbundle/pull/941) Thanks [@rschristian](https://github.com/rschristian)! - Ensures TS plugin will begin its search for a 'tsconfig.json' in the set cwd * [`f04c85a`](https://github.com/developit/microbundle/commit/f04c85a1885a28a16c767665a1d5f17b13834406) [#926](https://github.com/developit/microbundle/pull/926) Thanks [@developit](https://github.com/developit)! - Fix mangle.json being overwritten with `[object Object]` - [`ecb0b02`](https://github.com/developit/microbundle/commit/ecb0b022912397bcf98550c1a783e9e0534f33e5) [#947](https://github.com/developit/microbundle/pull/947) Thanks [@rschristian](https://github.com/rschristian)! - Ensures hoisted node_modules are excluded from babel * [`392d63e`](https://github.com/developit/microbundle/commit/392d63ef437f25403c03826f77790722d0234b58) [#919](https://github.com/developit/microbundle/pull/919) Thanks [@rschristian](https://github.com/rschristian)! - Fixes CSS output from being overwritten when also generating .cjs - [`fb0a437`](https://github.com/developit/microbundle/commit/fb0a43780a7462f4876955c3412638e51a7adb97) [#930](https://github.com/developit/microbundle/pull/930) Thanks [@rschristian](https://github.com/rschristian)! - Documenting --jsxFragment flag * [`8223eba`](https://github.com/developit/microbundle/commit/8223ebaee8d750e9757b9ddbfef6384fa00f22ac) [#948](https://github.com/developit/microbundle/pull/948) Thanks [@rschristian](https://github.com/rschristian)! - Corrects formatting in build completion message w/ dynamic import is used ## 0.14.2 ### Patch Changes - [`dd0bdde`](https://github.com/developit/microbundle/commit/dd0bdde9c6ae7d0690fa73aead1c1744ae3b086a) [#904](https://github.com/developit/microbundle/pull/904) Thanks [@rschristian](https://github.com/rschristian)! - Added missing CLI doc for 'jsxImportSource' and correcting the Examples section of the '--help' output ## 0.14.1 ### Patch Changes - [`2a0ca88`](https://github.com/developit/microbundle/commit/2a0ca8843f34c3773bb41eb3f8f571fb6b2b2d52) [#882](https://github.com/developit/microbundle/pull/882) Thanks [@MiKr13](https://github.com/MiKr13)! - feat: :sparkles: Closes #497: preserve trailing newline in mangle.json * [`26f382a`](https://github.com/developit/microbundle/commit/26f382a989e86fdcc5149f73f7b6c9d314a4bf37) [#895](https://github.com/developit/microbundle/pull/895) Thanks [@rschristian](https://github.com/rschristian)! - Completion message shows pkg's actual name, rather than safe name ## 0.14.0 ### Minor Changes - [`1b61029`](https://github.com/developit/microbundle/commit/1b6102966440bd7000e0e457f8c0b7eeb7e05593) [#867](https://github.com/developit/microbundle/pull/867) Thanks [@bouchenoiremarc](https://github.com/bouchenoiremarc)! - - Add support for Module Workers with a new `--workers` flag ### Patch Changes - [`5e93a0e`](https://github.com/developit/microbundle/commit/5e93a0e4cc28ea8f080a08e3a8530b6bfdf25f42) [#853](https://github.com/developit/microbundle/pull/853) Thanks [@developit](https://github.com/developit)! - Fix crash when traversing `"exports"` objects (#852) * [`96b85da`](https://github.com/developit/microbundle/commit/96b85da1e32b4ffbef9d83387ff399d8b3ee3852) [#887](https://github.com/developit/microbundle/pull/887) Thanks [@developit](https://github.com/developit)! - When using `--target node`, resolve "node" conditional Package Export keys, otherwise resolve "browser" keys. - [`5d0465b`](https://github.com/developit/microbundle/commit/5d0465b39bccff31673d351fc9d29cb4c470407d) [#875](https://github.com/developit/microbundle/pull/875) Thanks [@dwightjack](https://github.com/dwightjack)! - Preserve terser annotations in compressed bundle * [`b1a6374`](https://github.com/developit/microbundle/commit/b1a637486234a2ae784ccf0c512321e2d3efef7c) [#858](https://github.com/developit/microbundle/pull/858) Thanks [@bouchenoiremarc](https://github.com/bouchenoiremarc)! - - Allow the minify options `compress` and `mangle` to be set as booleans - [`2980336`](https://github.com/developit/microbundle/commit/29803364fe54cc1a7a8543d61e694c90b4cdce6a) [#865](https://github.com/developit/microbundle/pull/865) Thanks [@rschristian](https://github.com/rschristian)! - Expands generateTypes flag to support libs with TS entrypoints ## 0.13.3 ### Patch Changes - [`3534815`](https://github.com/developit/microbundle/commit/3534815ddabecc080cdec42cd1f6009a81a48ec9) [#848](https://github.com/developit/microbundle/pull/848) Thanks [@developit](https://github.com/developit)! - Bugfix: preserve Terser annotations like `/*@__NOINLINE__*/` during Babel pass ## 0.13.2 ### Patch Changes - [`e3f1933`](https://github.com/developit/microbundle/commit/e3f1933773fd17bb1d97de0dad94d899acee7598) [#847](https://github.com/developit/microbundle/pull/847) Thanks [@developit](https://github.com/developit)! - - Upgrade to Terser [5.7](https://github.com/terser/terser/blob/master/CHANGELOG.md#v570) to re-enable support for `reduce_funcs:false` in `mangle.json` configuration. * [`86371f0`](https://github.com/developit/microbundle/commit/86371f0db6386089c66cd474a7121d9dbee4c0cf) [#784](https://github.com/developit/microbundle/pull/784) Thanks [@rschristian](https://github.com/rschristian)! - Allows users to customize the modern output's filename using "exports" like they can with "esmodules" ## 0.13.1 ### Patch Changes - [`54402ac`](https://github.com/developit/microbundle/commit/54402ac43cc2f7ccb85fe5df2e9828c7f24091a0) [#830](https://github.com/developit/microbundle/pull/830) Thanks [@JounQin](https://github.com/JounQin)! - fix: add generateTypes cli option, check false value correctly * [`edcd777`](https://github.com/developit/microbundle/commit/edcd777cfaedfdb436c62b5dcb3cff6291268e4c) [#823](https://github.com/developit/microbundle/pull/823) Thanks [@rschristian](https://github.com/rschristian)! - Ensures ambient type declaration for CSS Modules is included in the published bundle - [`d87a5dc`](https://github.com/developit/microbundle/commit/d87a5dc286a1edba92ca3ec5b534807688c90854) Thanks [@developit](https://github.com/developit)! - - Fix `--sourcemap=false` to match `--no-sourcemap` and actually turn sourcemaps off. * [`6f1a20f`](https://github.com/developit/microbundle/commit/6f1a20fa17467176f9bc1acc2b0f78784d28d110) [#777](https://github.com/developit/microbundle/pull/777) Thanks [@rschristian](https://github.com/rschristian)! - Fixing a bug that would cause a CSS file to be generated to match each JS build output - [`25b73d2`](https://github.com/developit/microbundle/commit/25b73d22caeac7cf74b0533401318a5becc29c11) [#834](https://github.com/developit/microbundle/pull/834) Thanks [@cometkim](https://github.com/cometkim)! - Add support for configuration overrides using the `publishConfig` package.json field. * [`0a4cddf`](https://github.com/developit/microbundle/commit/0a4cddf98ab54c41f0b2ece1d626e459f73c9997) [#842](https://github.com/developit/microbundle/pull/842) Thanks [@ForsakenHarmony](https://github.com/ForsakenHarmony)! - fix default extension to cjs for package.json "type":"module" - [`4f7fbc4`](https://github.com/developit/microbundle/commit/4f7fbc4a0b9e03b9c33d10b21c66b8ddef7524a7) Thanks [@developit](https://github.com/developit)! - Fix `transform-fast-rest` to support referencing `...rest` params from within closures. * [`0c91795`](https://github.com/developit/microbundle/commit/0c917959570c788929766c6f4cd55f3b49433920) [#841](https://github.com/developit/microbundle/pull/841) Thanks [@rschristian](https://github.com/rschristian)! - Ensures JS format is not included in CSS filename output ## 0.13.0 ### Minor Changes - [`bd5d15e`](https://github.com/developit/microbundle/commit/bd5d15e17c882f2090f519d342dd89e694456ab8) [#738](https://github.com/developit/microbundle/pull/738) Thanks [@wardpeet](https://github.com/wardpeet)! - Upgrade rollup to version latest and upgrade all its dependencies * [`967f8d5`](https://github.com/developit/microbundle/commit/967f8d532785aa7bf8636c5a759759a3e72dcf56) [#769](https://github.com/developit/microbundle/pull/769) Thanks [@developit](https://github.com/developit)! - Add `--css inline` option. The default CSS output for all formats is now external files (as it was supposed to be). - [`8142704`](https://github.com/developit/microbundle/commit/8142704399efe6b4f34219c711a3932431781b36) [#741](https://github.com/developit/microbundle/pull/741) Thanks [@whitetrefoil](https://github.com/whitetrefoil)! - Use user's typescript first, fallback to bundled ### Patch Changes - [`12668b9`](https://github.com/developit/microbundle/commit/12668b993906a0267c53c3601ce89d1c0ddfbc27) [#687](https://github.com/developit/microbundle/pull/687) Thanks [@developit](https://github.com/developit)! - Add friendly microbundle-specific errors when modules can't be resolved. * [`8b60fc8`](https://github.com/developit/microbundle/commit/8b60fc86cbc493e23230a58cd0c99e2e0c675974) [#754](https://github.com/developit/microbundle/pull/754) Thanks [@stipsan](https://github.com/stipsan)! - Enable sourcemaps for CSS - [`fdafaf7`](https://github.com/developit/microbundle/commit/fdafaf7a4ad76b1757e2c0ff39050f8e11e2f1d5) [#764](https://github.com/developit/microbundle/pull/764) Thanks [@bakerkretzmar](https://github.com/bakerkretzmar)! - Add support for generating inline sourcemaps * [`52a1771`](https://github.com/developit/microbundle/commit/52a177190eb45791cb4b44d4bf04732b8b98d9c3) [#768](https://github.com/developit/microbundle/pull/768) Thanks [@developit](https://github.com/developit)! - Add ambient typescript declaration for CSS Modules ## 0.12.4 ### Patch Changes - [`ffcc9d9`](https://github.com/developit/microbundle/commit/ffcc9d9b7d9518ae2fa31b2af4d1fd4f98599560) [#713](https://github.com/developit/microbundle/pull/713) Thanks [@developit](https://github.com/developit)! - Support [extending a UMD global](https://rollupjs.org/guide/en/#outputextend) by prefixing the package.json `"amdName"` field (eg: `"global.xyz"`). * [`0527862`](https://github.com/developit/microbundle/commit/052786223edce8258c73a72a49238e41e5b24850) [#722](https://github.com/developit/microbundle/pull/722) Thanks [@developit](https://github.com/developit)! - Support "esm" (`-f esm`) as an alias of "es" format. - [`d08f977`](https://github.com/developit/microbundle/commit/d08f977aa6b19b267cf8d12861cc5cc34380d025) [#702](https://github.com/developit/microbundle/pull/702) Thanks [@wardpeet](https://github.com/wardpeet)! - Use @babel/preset-env with bugfixes instead of preset-modules to enable "Optional chaining" & "nullish coalescing" by default. * [`d33a7ba`](https://github.com/developit/microbundle/commit/d33a7ba2f5475e870d1a0f659b0c3ec0c459a850) [#731](https://github.com/developit/microbundle/pull/731) Thanks [@vaneenige](https://github.com/vaneenige)! - Add jsxImportSource flag for new JSX runtime - [`0fec414`](https://github.com/developit/microbundle/commit/0fec41493c39669270ba2b58401dc591e551d96d) [#716](https://github.com/developit/microbundle/pull/716) Thanks [@wardpeet](https://github.com/wardpeet)! - Don't transpile generators and async for Node * [`ba1c047`](https://github.com/developit/microbundle/commit/ba1c047512356e0e48911f5f037be798c5c2b9eb) [#701](https://github.com/developit/microbundle/pull/701) Thanks [@wardpeet](https://github.com/wardpeet)! - re-enable unpkg alias for umd bundles as described in the readme - [`3488411`](https://github.com/developit/microbundle/commit/34884116e21408305b337a9f6267f6c2ddc9e72d) [#700](https://github.com/developit/microbundle/pull/700) Thanks [@wardpeet](https://github.com/wardpeet)! - Disable warnings for node's builtin-modules when using node as a target environment. ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project author at jason@developit.ca. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2017-present Jason Miller Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================

microbundle

Microbundle npm travis licenses

The zero-configuration bundler for tiny modules, powered by Rollup.

---

Guide → SetupFormatsModern ModeUsage & ConfigurationAll Options

--- ## ✨ Features - **One dependency** to bundle your library using only a `package.json` - Support for ESnext & async/await _(via [Babel] & [async-to-promises])_ - Produces tiny, optimized code for all inputs - Supports multiple entry modules _(`cli.js` + `index.js`, etc)_ - Creates multiple output formats for each entry _(CJS, UMD & ESM)_ - 0 configuration TypeScript support - Built-in Terser compression & gzipped bundle size tracking ## 🔧 Installation & Setup 1️⃣ **Install** by running: `npm i -D microbundle` 2️⃣ **Set up** your `package.json`: ```jsonc { "name": "foo", // your package name "type": "module", "source": "src/foo.js", // your source code "exports": { "require": "./dist/foo.cjs", // used for require() in Node 12+ "default": "./dist/foo.modern.js" // where to generate the modern bundle (see below) }, "main": "./dist/foo.cjs", // where to generate the CommonJS bundle "module": "./dist/foo.module.js", // where to generate the ESM bundle "unpkg": "./dist/foo.umd.js", // where to generate the UMD bundle (also aliased as "umd:main") "scripts": { "build": "microbundle", // compiles "source" to "main"/"module"/"unpkg" "dev": "microbundle watch" // re-build when source files change } } ``` 3️⃣ **Try it out** by running `npm run build`. ## 💽 Output Formats Microbundle produces esm, cjs, umd bundles with your code compiled to syntax that works pretty much everywhere. While it's possible to customize the browser or Node versions you wish to support using a [browserslist configuration](https://github.com/browserslist/browserslist#browserslist-), the default setting is optimal and strongly recommended. ## 🤖 Modern Mode In addition to the above formats, Microbundle also outputs a `modern` bundle specially designed to work in _all modern browsers_. This bundle preserves most modern JS features when compiling your code, but ensures the result runs in 95% of web browsers without needing to be transpiled. Specifically, it uses Babel's ["bugfixes" mode](https://babeljs.io/blog/2020/03/16/7.9.0#babelpreset-envs-bugfixes-option-11083httpsgithubcombabelbabelpull11083) (previously known as [preset-modules](https://github.com/babel/preset-modules)) to target the set of browsers that support `