Skip to content

Commit

Permalink
Merge pull request #1164 from battle-ooze/fix-rax-script
Browse files Browse the repository at this point in the history
fix: rax-scripts component-miniapp bug
  • Loading branch information
Orange-C authored Jul 30, 2019
2 parents 4b42caa + 813652d commit 86b8d70
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/rax-scripts/src/config/component/gulpfile-miniapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const vinylBuffer = require('vinyl-buffer');
const babelConfig = require('./babel.config');

const cwd = process.cwd();
const FILES_PATTERN = `${cwd}/+(src|demo)/miniapp/**/*`;
const FILES_PATTERN = `${cwd}/+(src|demo)/**/*`;
const dist = path.resolve(cwd, './_miniapp');
const extTypes = ['ts', 'json', 'axml'];
const extTypes = ['js', 'ts', 'json', 'axml', 'acss'];

babelConfig.presets.unshift(require.resolve('@babel/preset-typescript'));

Expand All @@ -24,6 +24,13 @@ gulp.task('ts', () => {
.pipe(gulp.dest(dist));
});

gulp.task('js', () => {
return gulp
.src(`${FILES_PATTERN}.js`)
.pipe(babel(babelConfig))
.pipe(gulp.dest(dist));
});

gulp.task('json', () => {
return gulp.src(`${FILES_PATTERN}.json`).pipe(gulp.dest(dist));
});
Expand All @@ -32,6 +39,10 @@ gulp.task('axml', () => {
return gulp.src(`${FILES_PATTERN}.axml`).pipe(gulp.dest(dist));
});

gulp.task('acss', () => {
return gulp.src(`${FILES_PATTERN}.acss`).pipe(gulp.dest(dist));
});

gulp.task('app.js', () => {
const stream = source('app.js');
stream.write(`
Expand Down Expand Up @@ -93,7 +104,7 @@ gulp.task(
'default',
gulp.series(
'clean',
gulp.parallel('ts', 'json', 'axml', 'app file'),
gulp.parallel('js', 'ts', 'json', 'axml', 'acss', 'app file'),
gulp.series('watch')
)
);

0 comments on commit 86b8d70

Please sign in to comment.