Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('combine', ['cleanDir', 'chartpark'], async () => {
await spawnCommand('gulp', ['rely']);
combineTool.config({
tmplFolder: 'tmpl',
srcFolder: 'build/src'
})
return combineTool.combine().then(() => {
console.log('complete');
}).catch(ex => {
console.log('gulpfile:', ex);
});
});
gulp.task('build', ['cleanBuild','copyImagesBuild'], function() {
combineTool.config({
compressCss: true
});
combineTool.combine().then(() => {
gulp.src(srcFolder + '/**/*.js')
.pipe(uglify({
compress: {
drop_console: true
},
output: {
ascii_only: true
}
}))
.pipe(gulp.dest(buildFolder));
});
];
var onlyAllows = {
'.html': 1,
'.css': 1,
'.json': 1
};
var gulp = require('gulp');
var path = require('path');
var watch = require('gulp-watch');
var fs = require('fs');
var del = require('del');
var combineTool = require('magix-combine');
combineTool.config({
nanoOptions: {
safe: true
},
htmlminifierOptions: {
removeComments: true, //注释
collapseWhitespace: true, //空白
//removeAttributeQuotes: true, //属性引号
quoteCharacter: '"',
keepClosingSlash: true, //
},
excludeTmplFolders: excludeTmplFolders,
onlyAllows: onlyAllows,
prefix: 'mp-',
snippets: {
loading: '<div class="loading"><span></span></div>'
},
'tmpl/config.js',
'tmpl/fastclick.js'
];
var onlyAllows = {
'.html': 1,
'.css': 1
};
var gulp = require('gulp');
var watch = require('gulp-watch');
var fs = require('fs');
var combineTool = require('magix-combine');
var del = require('del');
combineTool.config({
tmplFolder: tmplFolder,
srcFolder: srcFolder,
buildFolder: buildFolder,
excludeTmplFolders: excludeTmplFolders,
onlyAllows: onlyAllows,
generateJSFile: function(o) {
var tmpl = wrapNoExports;
tmpl = o.requires.length ? wrapTMPL : wrapNoDepsTMPL;
for (var p in o) {
var reg = new RegExp('\\$\\{' + p + '\\}', 'g');
tmpl = tmpl.replace(reg, (o[p] + '').replace(/\$/g, '$$$$'));
}
return tmpl;
}
});