Skip to content

Commit

Permalink
output mjs files next to cjs files
Browse files Browse the repository at this point in the history
  • Loading branch information
DeMoorJasper committed Jul 4, 2022
1 parent 6e2ea78 commit f55bf67
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
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"
}
}
]
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

1 comment on commit f55bf67

@github-actions
Copy link

Choose a reason for hiding this comment

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

Parcel sourcemap benchmark

Benchmark suite Current: f55bf67 Previous: 6e2ea78 Ratio
consume#consume buffer 71720 ops/sec (±1.2e+2%) 45023 ops/sec (±1.4e+2%) 0.63
consume#consume JS Mappings 55577 ops/sec (±8.7%) 51066 ops/sec (±7.7%) 0.92
consume#consume vlq mappings 46931 ops/sec (±12%) 39291 ops/sec (±13%) 0.84
serialize#Save buffer 402 ops/sec (±0.78%) 327 ops/sec (±2.0%) 0.81
serialize#Serialize to vlq 290 ops/sec (±0.70%) 261 ops/sec (±2.5%) 0.90
modify#negative column offset 145012 ops/sec (±21%) 87382 ops/sec (±16%) 0.60
modify#positive column offset 141024 ops/sec (±31%) 86625 ops/sec (±23%) 0.61
modify#negative line offset 49456 ops/sec (±5.6%) 36271 ops/sec (±4.9%) 0.73
modify#positive line offset 49259 ops/sec (±7.5%) 36419 ops/sec (±8.0%) 0.74
append#addSourceMap 201 ops/sec (±0.51%) 168 ops/sec (±5.9%) 0.84

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.