Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rax-scripts component-miniapp bug #1164

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: rax-scripts component-miniapp bug
  • Loading branch information
battle-ooze committed Jul 29, 2019
commit 813652dbe7f973d169e06b0d3037d85a4590e314
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')
)
);