diff --git a/package.json b/package.json index 8d479ddb2..cab1fb126 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,12 @@ "immutable" ], "repository": "https://github.com/moment/luxon", + "exports": { + ".": { + "import": "./src/luxon.js", + "require": "./build/node/luxon.js" + } + }, "scripts": { "build": "babel-node tasks/buildAll.js", "build-node": "babel-node tasks/buildNode.js", @@ -21,6 +27,7 @@ "format-check": "prettier --check 'src/**/*.js' 'test/**/*.js' 'benchmarks/*.js'", "benchmark": "babel-node benchmarks/index.js", "codecov": "codecov", + "prepack": "babel-node tasks/buildAll.js", "prepare": "husky install" }, "lint-staged": { diff --git a/src/package.json b/src/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/src/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +}