Skip to content

Commit 62b8287

Browse files
committed
build(webpack): build TypeScript files as ESM fragments
1 parent c5fd267 commit 62b8287

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-scripts/config/webpack.config.bundle.esm.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ const paths = require('./paths');
66
const configFactory = require('./webpack.config');
77
const nodeExternals = require('webpack-node-externals');
88

9-
const pluginFiles = globby.sync(['plugins/*/index.js'], { cwd: paths.appSrc });
9+
const pluginFiles = globby.sync(['plugins/*/index.{js,ts}'], { cwd: paths.appSrc });
1010
const pluginEntries = pluginFiles.reduce((acc, plugin) => {
11-
acc[plugin.replace(/\.js$/, '')] = path.join(paths.appSrc, plugin);
11+
acc[plugin.replace(/\.(js|ts)$/, '')] = path.join(paths.appSrc, plugin);
1212
return acc;
1313
}, {});
14-
const presetFiles = globby.sync(['presets/*/index.js'], { cwd: paths.appSrc });
14+
const presetFiles = globby.sync(['presets/*/index.{js,ts}'], { cwd: paths.appSrc });
1515
const presetEntries = presetFiles.reduce((acc, preset) => {
16-
acc[preset.replace(/\.js$/, '')] = path.join(paths.appSrc, preset);
16+
acc[preset.replace(/\.(js|ts)$/, '')] = path.join(paths.appSrc, preset);
1717
return acc;
1818
}, {});
1919

0 commit comments

Comments
 (0)