Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an ESM compatible build to grunt script via Rollup #99

Merged
merged 6 commits into from
Aug 2, 2023

Conversation

NiloCK
Copy link
Contributor

@NiloCK NiloCK commented May 1, 2023

Closes #98.

This PR makes js-big-decimal easier to import in (at least some) current build / bundle pipelines. See related thread vitejs/vite#13031 for more context.

npm run dist now produces an esm folder, and package.json points to its output with its modules field. Existing build steps are intact - npm run dist reproduces the previous node and web folders.

Build has been tested with a canary publish to https://www.npmjs.com/package/js-big-decimal-esm - importing this module resolves the issue between vite & js-big-decimal.

@royNiladri
Copy link
Owner

royNiladri commented May 3, 2023

Looks like the changes broke expectations for existing checks. Please have a look! @NiloCK

return carry ? (carry.toString() + sum) : sum;
}
function testZero(number) {
return (/^0[0]*[.]{0,1}[0]*$/.test(number));

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings starting with '0' and with many repetitions of '0'. This [regular expression](1) that depends on [library input](3) may run slow on strings starting with '0' and with many repetitions of '0'. This [regular expression](1) that depends on [library input](4) may run slow on strings starting with '0' and with many repetitions of '0'. This [regular expression](1) that depends on [library input](5) may run slow on strings starting with '0' and with many repetitions of '0'. This [regular expression](1) that depends on [library input](6) may run slow on strings starting with '0' and with many repetitions of '0'. This [regular expression](1) that depends on [library input](7) may run slow on strings starting with '0' and with many repetitions of '0'. This [regular expression](1) that depends on [library input](8) may run slow on strings starting with '0' and with many repetitions of '0'.
@royNiladri royNiladri changed the base branch from master to esm-pr August 2, 2023 10:11
@royNiladri royNiladri merged commit b8e3cf0 into royNiladri:esm-pr Aug 2, 2023
royNiladri added a commit that referenced this pull request Aug 2, 2023
* Bugfix #84 fixed buggy round

* 1.3.11

* 1.3.12

* bugfix #63: fix addition of -0

* build files

* 1.3.13

* added devcontainer

* changed gulpfile for macos

* added feature 'abs' #83

* 1.3.14

* added abs to readme

* 1.3.15

* semantic dependency updates

* Add feature for #32 setValue

* 1.4.0

* Merge branch 'master' of https://github.com/royNiladri/js-big-decimal into development

* upadted packagelock

* 1.4.1

* Add an ESM compatible build to grunt script via Rollup (#99)

* add rollup dev dependencies

* change export mechanism...

This does not change the `dist` command's current outputs

* add rollup es module bundling to grunt dist task

* Fix typo

* add "module" esm target file

* add built esm outputs

* fixed tests for esm

* 2.0.0

---------

Co-authored-by: Niladri Roy <[email protected]>
Co-authored-by: Colin Kennedy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import errors with vite project
2 participants