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

feat: Write ESModule files for deno and other ESM runtimes #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc → babelrc.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"@babel/preset-env",
{
"targets": {
"node": "10"
"node": "12"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer allow 10 in engines, so this should be fine

}
}
]
Expand Down
14 changes: 14 additions & 0 deletions babelrc.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
"@babel/preset-flow",
[
"@babel/preset-env",
{
"targets": {
"node": "12"
},
"modules": false
}
]
]
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@parcel/source-map",
"version": "2.1.0",
"main": "./dist/node.js",
"module": "./dist/node.mjs",
"types": "index.d.ts",
"license": "MIT",
"repository": {
Expand All @@ -15,7 +16,9 @@
"benchmark": "node ./bench/run",
"benchmark:node": "cross-env BACKEND=node yarn benchmark",
"benchmark:wasm": "cross-env BACKEND=wasm yarn benchmark",
"transpile": "babel ./src/*.js --out-dir ./dist && flow-copy-source -v src dist",
"transpile:cjs": "babel ./src/*.js --out-dir ./dist --config-file ./babelrc.cjs.json",
"transpile:esm": "babel ./src/*.js --out-dir ./dist --out-file-extension .mjs --config-file ./babelrc.esm.json",
"transpile": "yarn transpile:cjs && yarn transpile:esm && flow-copy-source -v src dist",
"build:clean": "cd ./parcel_sourcemap_node && rm -rf artifacts && mkdir artifacts",
"build:node": "yarn build:clean && node parcel_sourcemap_node/build.js",
"build:node-release": "yarn build:clean && node parcel_sourcemap_node/build.js --release",
Expand Down