-
-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
294 changed files
with
2,194 additions
and
7,641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build/*.js | ||
config/*.js | ||
example/*.js | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
const { | ||
src, | ||
dest, | ||
parallel | ||
} = require('gulp'); | ||
const less = require('gulp-less'); | ||
const imagemin = require('gulp-imagemin'); | ||
const cssmin = require('gulp-clean-css'); | ||
const jsonmin = require('gulp-jsonminify'); | ||
const jsmin = require('gulp-uglify-es').default; | ||
const wxmlmin = require('gulp-htmlmin'); | ||
const rename = require('gulp-rename'); | ||
const del = require('del'); | ||
|
||
const buildWxss = (srcPath, remainPath, distPath) => () => | ||
src([srcPath, remainPath]) | ||
.pipe(less()) | ||
.pipe(cssmin()) | ||
.pipe(rename(srcPath => { | ||
srcPath.extname = '.wxss'; | ||
})) | ||
.pipe(dest(distPath)); | ||
|
||
const copy = (srcPath, distPath, ext) => () => | ||
src(`${srcPath}/*.${ext}`) | ||
.pipe(dest(distPath)); | ||
|
||
const buildWxml = (srcPath, remainPath, distPath) => () => | ||
src([srcPath, remainPath]) | ||
.pipe(wxmlmin({ | ||
removeComments: true, | ||
// collapseWhitespace: true, | ||
keepClosingSlash: true, | ||
caseSensitive: true | ||
})) | ||
.pipe(dest(distPath)); | ||
|
||
const buildJson = (srcPath, distPath) => () => | ||
src(srcPath) | ||
.pipe(jsonmin()) | ||
.pipe(dest(distPath)); | ||
|
||
const buildJs = (srcPath, distPath) => () => | ||
src(srcPath) | ||
.pipe(jsmin()) | ||
.pipe(dest(distPath)); | ||
|
||
const buildImage = (srcPath, distPath) => () => | ||
src(srcPath) | ||
.pipe(imagemin()) | ||
.pipe(dest(distPath)); | ||
|
||
const copyStatic = (srcPath, distPath, env = 'build') => { | ||
if (env === 'build') { | ||
return parallel( | ||
copy(srcPath, distPath, 'wxs') | ||
); | ||
} else { | ||
return parallel( | ||
copy(srcPath, distPath, 'wxml'), | ||
copy(srcPath, distPath, 'wxs'), | ||
copy(srcPath, distPath, 'json'), | ||
copy(srcPath, distPath, 'js'), | ||
copy(srcPath, distPath, 'png') | ||
); | ||
} | ||
} | ||
|
||
const clean = (cleanPath) => () => | ||
del([cleanPath], { | ||
force: true | ||
}); | ||
|
||
module.exports = { | ||
buildWxss, | ||
buildWxml, | ||
buildImage, | ||
buildJson, | ||
buildJs, | ||
copyStatic, | ||
clean, | ||
copy | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"l-icon":"../icon/index", | ||
"l-popup":"../popup/index", | ||
"l-button":"../button/index" | ||
} | ||
} | ||
{"component":true,"usingComponents":{"l-icon":"../icon/index","l-popup":"../popup/index","l-button":"../button/index"} } |
Oops, something went wrong.