Skip to content

Commit

Permalink
✨ Use esm default
Browse files Browse the repository at this point in the history
  • Loading branch information
nuintun committed May 9, 2022
1 parent 1663494 commit 643513c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/qrcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module QRCode
* @package @nuintun/qrcode
* @license MIT
* @version 3.2.0
* @version 3.3.0
* @author nuintun <[email protected]>
* @description A pure JavaScript QRCode encode and decode library.
* @see https://github.com/nuintun/qrcode#readme
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"name": "@nuintun/qrcode",
"version": "3.2.0",
"version": "3.3.0",
"description": "A pure JavaScript QRCode encode and decode library.",
"main": "cjs/index.js",
"type": "module",
"main": "cjs/index.cjs",
"module": "esm/index.js",
"types": "types/index.d.ts",
"exports": {
"import": "./esm/index.js",
"require": "./cjs/index.cjs"
},
"files": [
"cjs",
"esm",
Expand Down
2 changes: 1 addition & 1 deletion tools/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module clean
*/

const rimraf = require('rimraf');
import rimraf from 'rimraf';

function clean(paths) {
paths = Array.isArray(paths) ? paths : [paths];
Expand Down
4 changes: 3 additions & 1 deletion tools/rollup.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export default function rollup(esnext) {
exports: 'auto',
esModule: false,
dir: esnext ? 'esm' : 'cjs',
format: esnext ? 'esm' : 'cjs'
format: esnext ? 'esm' : 'cjs',
entryFileNames: `[name].${esnext ? 'js' : 'cjs'}`,
chunkFileNames: `[name].${esnext ? 'js' : 'cjs'}`
},
external: ['tslib'],
preserveModules: true,
Expand Down

0 comments on commit 643513c

Please sign in to comment.