Open southwhale opened 2 years ago
I added the code below to main.js, but it did not work.
babel: async (options) => ({
...options,
// any extra options you want to set
"presets": [
[
"@babel/env",
{
"targets": {
"esmodules": true
}
}
],
["@babel/react"]
],
"env": {
"camo-test": {
"plugins": [
[
"@babel/transform-runtime",
{
"regenerator": true
}
],
"@babel/plugin-syntax-dynamic-import"
],
"presets": [
[
"@babel/env",
{
"targets": {
"esmodules": true
}
}
],
["@babel/react"]
]
},
"test": {
"plugins": [
[
"@babel/transform-runtime",
{
"regenerator": true
}
],
"@babel/plugin-syntax-dynamic-import"
],
"presets": [
[
"@babel/env",
{
"targets": {
"esmodules": true
}
}
],
["@babel/react"]
]
}
}
}),
It is possible to extend storybook's webpack config as documented here - https://storybook.js.org/docs/react/configure/webpack#extending-storybooks-webpack-config
you could set the targets
property to targets: ["web", "es5"]
that should solve the problem
How to make the built output target be es5? It seems that the default output target is es6, and I can't change it. I have tried many times and I can't find the way to make the ouput target be es5. Please give me some help. Thanks.
Storybook version: 6.4.22 React version: 17.0.2