π’ split/precompile mina single-file-component
npm install --save-dev @tinajs/gulp-mina
const gulp = require('gulp') const babel = require('gulp-babel') const mina = require('@tinajs/gulp-mina') gulp.task('default', () => { return gulp.src('src/**/*.mina') .pipe(mina({ script: (stream) => stream.pipe(babel({ presets: ['env'] })), })) .pipe(gulp.dest('dist')) })
const gulp = require('gulp') const babel = require('gulp-babel') const mina = require('@tinajs/gulp-mina') gulp.task('default', ['clean'], () => { return gulp.src('src/**/*.mina') .pipe(mina.split({ script: (stream) => stream.pipe(babel({ presets: ['env'] })), })) .pipe(gulp.dest('dist')) })
Separate mina-sfc to multiple streams, and pipe the recombined results down.
Type: Object
Default: {}
Each separated streams of mina-sfc file will be passed to these mapping functions.
Type: Function
Receive the stream of <script> part as a .js file.
Type: Function
Receive the stream of <config> part as a .json file.
Type: Function
Receive the stream of <style> part as a .wxss file.
Type: Function
Receive the stream of <template> part as a .wxml file.
Just like mina([mapping]), but pipe separated mina-sfc as multiple files to the downstream.
MIT Β© yelo, 2017 - present