Skip to content

Commit 9e1ebfe

Browse files
committed
Support .d.ts file
1 parent c2b4eb2 commit 9e1ebfe

File tree

1 file changed

+7
-4
lines changed
  • packages/react-dependency-scripts/scripts

1 file changed

+7
-4
lines changed

packages/react-dependency-scripts/scripts/build.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
process.env.NODE_ENV = 'production';
44
process.env.BABEL_ENV = 'production';
55

6-
process.on('unhandledRejection', err => {
6+
process.on('unhandledRejection', (err) => {
77
throw err;
88
});
99

@@ -14,7 +14,7 @@ const deletePath = require('../utils/deletePath');
1414
const resolverPath = require('../utils/resolverPath');
1515
const babelConfig = require('../configs/babelConfig');
1616

17-
process.on('unhandledRejection', err => {
17+
process.on('unhandledRejection', (err) => {
1818
throw err;
1919
});
2020

@@ -27,10 +27,13 @@ console.log(`Create directory:\t${BUILD_PATH}`);
2727

2828
const files = readAllFiles(APP_PATH);
2929

30-
files.map(path => {
30+
files.map((path) => {
3131
const newPath = path.name.replace(APP_PATH, BUILD_PATH);
3232
if (path.isFile) {
33-
if (path.name.match('^.+\\.(js|jsx|ts|tsx)$')) {
33+
if (
34+
path.name.match('^.+\\.(js|jsx|ts|tsx)$') &&
35+
!path.name.match('^.+\\.d.ts$')
36+
) {
3437
const result = babel.transformFileSync(path.name, babelConfig);
3538
fs.appendFileSync(newPath, result.code);
3639
} else {

0 commit comments

Comments
 (0)