Skip to content

Commit d33190f

Browse files
committed
fix: use correct export entry
1 parent f189917 commit d33190f

File tree

6 files changed

+7
-23
lines changed

6 files changed

+7
-23
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This lib allows you to build and write an Excel file dynamically, it does **not*
2121
### Comparison to similar libraries
2222

2323
Excel-buider-vanilla is at the minimum 6x times smaller than the most popular libraries (we used `Bundlephobia` to compare), excel-builder-vanilla is 22Kb gzip while [XLSX](https://bundlephobia.com/package/xlsx) is 136Kb and [ExcelJS](https://bundlephobia.com/package/exceljs) is 251Kb gzip. The reason as to why it's much smaller is simple and relates to 2 major differences:
24-
- excel-builder-vanilla is ESM and all other libraries are CJS only (CommonJS) increasing their download size
24+
- excel-builder-vanilla is ESM-Only and all other libraries are only offering CJS (CommonJS) increasing their download/install size
2525
- excel-builder-vanilla only offers Excel export (writing) but without any reading capabilities
2626

2727
## Live Demo
@@ -38,7 +38,7 @@ You can also take a look at the "[Used by](#used-by)" section below to see real
3838
[MIT License](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/LICENSE.md)
3939

4040
## Project History
41-
Excel-Builder-Vanilla is a fork of the popular [excel-builder.js](https://github.com/stephenliberty/excel-builder.js) project (thanks to @stephenliberty for this great library). The main goal of creating this fork was to modernize the project by removing old dependencies that are no longer necessary and also replace `JSZip` by `fflate` which provides an ESM build and is indirectly giving us better Tree Shaking. The other goal was also to provide an ESM build to eventually get away from CommonJS (CJS bundle is still offered but we strongly suggest that you migrate to the ESM approach)
41+
Excel-Builder-Vanilla is a fork of the popular [excel-builder.js](https://github.com/stephenliberty/excel-builder.js) project (thanks to @stephenliberty for this great library). The main goal of creating this fork was to modernize the project by removing old dependencies that are no longer necessary and also replace `JSZip` by `fflate` which provides an ESM build and is indirectly giving us better Tree Shaking. The other goal was also to provide an ESM build
4242

4343
The modernization steps:
4444
- migrate to TypeScript (which is giving us TS Types `d.ts`)
@@ -64,16 +64,12 @@ npm install excel-builder-vanilla
6464

6565
The project offers 3 different build types, choose the best one depending on your use case
6666
1. **ESM**: to `import from` (_**preferred**_)
67-
2. **CJS**: CommonJS to support old NodeJS `require()` - will probably be dropped in the future
68-
3. **IIFE**: standalone script which provides `ExcelBuilder` on the `window` object
67+
2. **IIFE**: standalone script which provides `ExcelBuilder` on the `window` object
6968

7069
```ts
7170
// ESM (preferred) - npm install
7271
import { createWorksheet } from 'excel-builder-vanilla';
7372

74-
// CJS - npm install
75-
const { createWorksheet } = require('excel-builder-vanilla');
76-
7773
// IIFE - CDN
7874
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/excel-builder.iife.js"></script>
7975
<script>
@@ -92,7 +88,7 @@ Please note that since we use `fflate` (which creates and compresses the Excel f
9288

9389
### Used by
9490

95-
This fork was created mostly to support Tree Shaking (ESM), to get away from CJS, to provide TS Types and finally to update all project dependencies. It is used by a few other Open Source libraries that I also maintain and require Excel export:
91+
This fork was created mostly to support Tree Shaking (ESM), to provide TS Types and finally to update all project dependencies. It is used by a few other Open Source libraries that I also maintain and require Excel export:
9692

9793
- [Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid)
9894
- [Aurelia-Slickgrid](https://github.com/ghiscoding/aurelia-slickgrid)
@@ -137,7 +133,7 @@ Before submitting a PR (pull request), please make sure that you followed these
137133
| Package Name | NPM downloads | Size (gzip) | Changes | Description |
138134
| -------------| ------- | ----------- | ------- | ----------- |
139135
| [excel-builder-vanilla](https://github.com/ghiscoding/excel-builder-vanilla/tree/main/packages/excel-builder-vanilla) | [![NPM downloads](https://img.shields.io/npm/dm/excel-builder-vanilla)](https://npmjs.org/package/excel-builder-vanilla) | [![npm bundle size](https://img.shields.io/bundlephobia/minzip/excel-builder-vanilla?color=success&label=gzip)](https://bundlephobia.com/result?p=excel-builder-vanilla) | [changelog](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/packages/excel-builder-vanilla/CHANGELOG.md) | `excel-builder-vanilla` library package |
140-
| [excel-builder-vanilla-types](https://github.com/ghiscoding/excel-builder/tree/main/packages/excel-builder-vanilla-types) | [![NPM downloads](https://img.shields.io/npm/dm/@excel-builder-vanilla/types)](https://npmjs.org/package/@excel-builder-vanilla/types) | [![npm bundle size](https://img.shields.io/bundlephobia/minzip/@excel-builder-vanilla/types?color=success&label=gzip)](https://bundlephobia.com/result?p=@excel-builder-vanilla/types) | [changelog](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/packages/excel-builder-vanilla-types/CHANGELOG.md) | `excel-builder-vanilla` dts types only package.
136+
| [[excel-builder-vanilla-types](https://github.com/ghiscoding/excel-builder-vanilla/tree/main/packages/excel-builder-vanilla-types) | [![NPM downloads](https://img.shields.io/npm/dm/@excel-builder-vanilla/types)](https://npmjs.org/package/@excel-builder-vanilla/types) | [![npm bundle size](https://img.shields.io/bundlephobia/minzip/@excel-builder-vanilla/types?color=success&label=gzip)](https://bundlephobia.com/result?p=@excel-builder-vanilla/types) | [changelog](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/packages/excel-builder-vanilla-types/CHANGELOG.md) | `excel-builder-vanilla` dts types only package.
141137

142138
## Sponsors
143139

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@types/node": "^22.14.1",
6060
"@vitest/coverage-v8": "^3.1.1",
6161
"conventional-changelog-conventionalcommits": "^8.0.0",
62-
"cross-env": "^7.0.3",
6362
"happy-dom": "^17.4.4",
6463
"pnpm": "^9.10.0",
6564
"rimraf": "^6.0.1",

packages/excel-builder-vanilla-types/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"access": "public"
2323
},
2424
"type": "module",
25+
"main": "./dist/index.js",
2526
"exports": {
2627
".": {
2728
"types": "./dist/index.d.ts",

packages/excel-builder-vanilla/copy-types.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ copyfiles([source, destination], { stat: true }, err => {
99
console.error(err);
1010
} else {
1111
// all good, next step, create JS entry file
12-
writeFileSync(`${destination}/dist/index.mjs`, `'use strict';`);
12+
writeFileSync(`${destination}/dist/index.js`, `'use strict';`);
1313
}
1414
});

pnpm-lock.yaml

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)