Skip to content

Commit 5033845

Browse files
refactor: forEach/push -> map
1 parent af53118 commit 5033845

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

esbuild.config.prod.mjs

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,27 @@ const buildsConfig = [
4545
},
4646
]
4747

48-
const builds = []
49-
50-
buildsConfig.forEach(({ format, outfile, minify }) => {
51-
builds.push(
52-
esbuild.build({
53-
entryPoints: ['./src/index.tsx'],
54-
bundle: true,
55-
outfile,
56-
format,
57-
treeShaking: true,
58-
minify,
59-
sourcemap: true,
60-
external: ['react', 'react-dom', 'prop-types'],
61-
plugins: [
62-
cssModulesPlugin({
63-
// inject: true,
64-
v2: true,
65-
v2CssModulesOption: {
66-
pattern: `react-tooltip__[local]_[hash]`,
67-
},
68-
}),
69-
],
70-
}),
71-
)
72-
})
48+
const builds = buildsConfig.map(({ format, outfile, minify }) =>
49+
esbuild.build({
50+
entryPoints: ['./src/index.tsx'],
51+
bundle: true,
52+
outfile,
53+
format,
54+
treeShaking: true,
55+
minify,
56+
sourcemap: true,
57+
external: ['react', 'react-dom', 'prop-types'],
58+
plugins: [
59+
cssModulesPlugin({
60+
// inject: true,
61+
v2: true,
62+
v2CssModulesOption: {
63+
pattern: `react-tooltip__[local]_[hash]`,
64+
},
65+
}),
66+
],
67+
}),
68+
)
7369

7470
await Promise.all(builds)
7571

0 commit comments

Comments
 (0)