Babel config #229
petarvujovic98
started this conversation in
Ideas
Replies: 2 comments
-
FYI this is how it would look if we did it the programmatic way:
// start of the file
babel({
babelHelpers: "bundled",
extensions: [".ts", ".js", ".jsx", ".es6", ".es", ".mjs"],
presets: ["@babel/preset-typescript"],
plugins: [
"near-sdk-js/lib/build-tools/include-bytes",
"near-sdk-js/lib/build-tools/near-bindgen-exporter",
["@babel/plugin-proposal-decorators", { version: "legacy" }],
],
}),
// the rest of the file |
Beta Was this translation helpful? Give feedback.
0 replies
-
@petarvujovic98 it's a technical dept that we have. Yes, let's add this config programmatically! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Do we want to expose the babel config to the user? Right now any
JavaScript
smart contract project would have ababel.config.json
file with our preset of plugins and presets. IMO this adds an additional file that the user has in their project, but we don't want them messing with it.We could just pass the same configuration programmatically to the
babel
call inside of our build script and thus avoid the need for this config file.If however we have plans to add options that the user could customize through the config file, then it would be sensible to create our own preset so that there is only one import line of our own in that config file.
Please share your thoughts
Beta Was this translation helpful? Give feedback.
All reactions