module.exports
"format"?
#8233
Answered
by
mischnic
jakubmazanec
asked this question in
Q&A
-
Does Parcel have setting like Rollup's https://rollupjs.org/guide/en/#outputexports ? It seems to me that if I try bundling simple library: // package.json
{
"name": "my-library",
"version": "1.0.0",
"source": "src/index.js",
"main": "dist/main.js",
"devDependencies": {
"parcel": "latest"
}
} // src/index.js
export default function add(a, b) {
return a + b;
} Parcel always outputs code that adds properties to // dist/main.js
/* ... */
$parcel$export(module.exports, "default", () => $4fa36e821943b400$export$2e2bcd8739ae039);
function $4fa36e821943b400$export$2e2bcd8739ae039(a, b) {
return a + b;
}
/* ... */ But I want |
Beta Was this translation helpful? Give feedback.
Answered by
mischnic
Jun 19, 2022
Replies: 1 comment 1 reply
-
You should be able to do |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jakubmazanec
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should be able to do
module.exports = function add() { ... }
in your source and get the result you want