Skip to content

Commit 2b77a42

Browse files
committed
Update build script to ignore d.ts files when babeling
1 parent a1a32c1 commit 2b77a42

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/build.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
const childProcess = require('child_process');
22

3+
const BABEL_OPTIONS = `--config-file ./src/.babelrc.json --extensions '.ts,.tsx' --ignore "src/**/*.d.ts"`;
4+
35
console.info('## Start RNUILib Build ##');
46

57
console.info('## Build Typescript ##');
68
childProcess.execSync('tsc --p tsconfig.build.json');
79

8-
console.info('## Build src files ##');
9-
childProcess.execSync(`./node_modules/.bin/babel src --out-dir src --config-file ./src/.babelrc.json --extensions '.ts,.tsx'`);
10+
console.info('## Build src files - convert TS to JS files ##');
11+
childProcess.execSync(`./node_modules/.bin/babel src --out-dir src ${BABEL_OPTIONS}`);
1012

11-
console.info('## Build lib (native component) files ##');
12-
childProcess.execSync(`./node_modules/.bin/babel lib --out-dir lib --config-file ./src/.babelrc.json --extensions '.ts,.tsx'`);
13+
console.info('## Build lib (native component) files - convert TS to JS files ##');
14+
childProcess.execSync(`./node_modules/.bin/babel lib --out-dir lib ${BABEL_OPTIONS}`);
1315

1416
console.info('## Build standalone components packages ##');
1517
require('./buildPackages');

0 commit comments

Comments
 (0)