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'))
})
wxml
, wxss
, json
and js
)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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。