Skip to content

Commit eebc657

Browse files
Add support for ESM-style node imports (#1218)
1 parent f1c181c commit eebc657

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
"immutable"
99
],
1010
"repository": "https://github.com/moment/luxon",
11+
"exports": {
12+
".": {
13+
"import": "./src/luxon.js",
14+
"require": "./build/node/luxon.js"
15+
}
16+
},
1117
"scripts": {
1218
"build": "babel-node tasks/buildAll.js",
1319
"build-node": "babel-node tasks/buildNode.js",
@@ -21,6 +27,7 @@
2127
"format-check": "prettier --check 'src/**/*.js' 'test/**/*.js' 'benchmarks/*.js'",
2228
"benchmark": "babel-node benchmarks/index.js",
2329
"codecov": "codecov",
30+
"prepack": "babel-node tasks/buildAll.js",
2431
"prepare": "husky install"
2532
},
2633
"lint-staged": {

src/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

0 commit comments

Comments
 (0)