Skip to content

Commit e2c9d05

Browse files
authored
138 build support for frontend libraries without "default" (#141)
* Fix #138 for import issues
1 parent 8e57d05 commit e2c9d05

13 files changed

Lines changed: 36 additions & 17 deletions

dist/esm/big-decimal.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ declare class bigDecimal {
3333
static stripTrailingZero(number: any): any;
3434
stripTrailingZero(): bigDecimal;
3535
}
36+
export { bigDecimal };
3637
export default bigDecimal;

dist/esm/big-decimal.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/big-decimal.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node/big-decimal.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ declare class bigDecimal {
3333
static stripTrailingZero(number: any): any;
3434
stripTrailingZero(): bigDecimal;
3535
}
36+
export { bigDecimal };
3637
export default bigDecimal;

dist/node/js-big-decimal.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,10 @@ var __webpack_exports__ = {};
706706
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
707707
!function() {
708708
var exports = __webpack_exports__;
709+
var __webpack_unused_export__;
709710

710-
Object.defineProperty(exports, "__esModule", ({ value: true }));
711+
__webpack_unused_export__ = ({ value: true });
712+
__webpack_unused_export__ = void 0;
711713
var add_1 = __webpack_require__(217);
712714
var abs_1 = __webpack_require__(165);
713715
var round_1 = __webpack_require__(350);
@@ -921,9 +923,11 @@ var bigDecimal = /** @class */ (function () {
921923
bigDecimal.RoundingModes = roundingModes_1.RoundingModes;
922924
return bigDecimal;
923925
}());
926+
__webpack_unused_export__ = bigDecimal;
924927
exports["default"] = bigDecimal;
925928

926929
}();
930+
__webpack_exports__ = __webpack_exports__["default"];
927931
/******/ return __webpack_exports__;
928932
/******/ })()
929933
;

dist/node/js-big-decimal.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/js-big-decimal.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,10 @@ var __webpack_exports__ = {};
697697
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
698698
!function() {
699699
var exports = __webpack_exports__;
700+
var __webpack_unused_export__;
700701

701-
Object.defineProperty(exports, "__esModule", ({ value: true }));
702+
__webpack_unused_export__ = ({ value: true });
703+
__webpack_unused_export__ = void 0;
702704
var add_1 = __webpack_require__(217);
703705
var abs_1 = __webpack_require__(165);
704706
var round_1 = __webpack_require__(350);
@@ -912,9 +914,10 @@ var bigDecimal = /** @class */ (function () {
912914
bigDecimal.RoundingModes = roundingModes_1.RoundingModes;
913915
return bigDecimal;
914916
}());
917+
__webpack_unused_export__ = bigDecimal;
915918
exports["default"] = bigDecimal;
916919

917920
}();
918-
bigDecimal = __webpack_exports__;
921+
bigDecimal = __webpack_exports__["default"];
919922
/******/ })()
920923
;

dist/web/js-big-decimal.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

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

package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
{
22
"name": "js-big-decimal",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"description": "Work with large numbers on the client side. Round them off to any required precision.",
5-
"main": "dist/node/js-big-decimal",
6-
"types": "dist/node/big-decimal",
5+
"main": "dist/node/js-big-decimal.js",
6+
"types": "dist/node/big-decimal.d.ts",
77
"module": "dist/esm/big-decimal.js",
8+
"exports": {
9+
".": {
10+
"require": "./dist/node/js-big-decimal.js",
11+
"import": "./dist/esm/big-decimal.js",
12+
"types": "./dist/node/big-decimal.d.ts"
13+
}
14+
},
815
"scripts": {
916
"test": "ts-node node_modules/jasmine/bin/jasmine --config=spec/jasmine.json --helper=spec/helper/*.js",
1017
"test:watch": "chokidar \"src/**/*.ts\" -c \"npm run travis-test\"",
@@ -68,6 +75,5 @@
6875
"typescript": "^4.9.5",
6976
"webpack": "^5.75.0",
7077
"webpack-cli": "^4.10.0"
71-
},
72-
"false": {}
78+
}
7379
}

0 commit comments

Comments
 (0)