How to use DIST_DIR method in Best

Best JavaScript code snippet using best

build.js

Source:build.js Github

copy

Full Screen

1var mkdirp = require('mkdirp');2var jsonfile = require('jsonfile')3var fs = require('fs');4var xml2js = require('xml2js');5var CleanCSS = require('clean-css');6var UglifyJS = require("uglify-js");7// detect version8var version = 'unknown';9var pattern = new RegExp(/^[\d]+\.[\d]+\.[\d]+$/);10process.argv.forEach(function (val, index, array) {11 if(pattern.test(val)){12 version = val;13 }14});15var dist_dir = "./dist";16if(!fs.existsSync(dist_dir)){17 fs.mkdirSync(dist_dir);18}19var vendors = []20var tasks = [];21// Print build version22tasks.push(function (resolve, reject) {23 console.log("Building version of " + version);24 resolve();25});26// Remove dist directory27tasks.push(function (resolve, reject) {28 var dirs = [];29 dirs.push(dist_dir);30 31 while(dirs.length > 0){32 var path = dirs[0];33 dirs.splice(0,1);34 if(!fs.existsSync(path))35 continue;36 var list = fs.readdirSync(path);37 var d_inc = 0;38 list.forEach(function(file,index){39 var curPath = path + "/" + file;40 if(fs.lstatSync(curPath).isDirectory()) { // recurse41 dirs.push(curPath);42 d_inc++;43 } else { // delete file44 fs.unlinkSync(curPath);45 }46 })47 if(d_inc == 0){48 fs.rmdirSync(path)49 }else{50 dirs.push(path);51 }52 }53 resolve();54});55 56// Make dirs57var mkDirsList = []58mkDirsList.push(dist_dir)59mkDirsList.push(dist_dir + "/css")60mkDirsList.push(dist_dir + "/images")61mkDirsList.push(dist_dir + "/js")62mkDirsList.push(dist_dir + "/vendor")63mkDirsList.push(dist_dir + "/swf")64mkDirsList.push(dist_dir + "/files")65mkDirsList.push(dist_dir + "/files/font")66mkDirsList.push(dist_dir + "/files/fonts")67mkDirsList.push(dist_dir + "/files/fonts/SegoeUIItalic")68mkDirsList.push(dist_dir + "/files/fonts/SegoeUIRegular")69mkDirsList.push(dist_dir + "/files/js")70mkDirsList.push(dist_dir + "/files/js/app")71mkDirsList.push(dist_dir + "/files/js/app/views")72mkDirsList.push(dist_dir + "/files/js/app/controllers")73mkDirsList.push(dist_dir + "/files/js/lib")74mkDirsList.push(dist_dir + "/files/tz")75mkDirsList.push(dist_dir + "/files/images")76mkDirsList.push(dist_dir + "/files/images/player")77mkDirsList.push(dist_dir + "/files/images/camera_setting")78tasks.push(function (resolve, reject) {79 console.log("Make dirs");80 for(var i = 0; i < mkDirsList.length; i++){81 if(!fs.existsSync(mkDirsList[i])){82 console.log("Create dir " + mkDirsList[i]);83 fs.mkdirSync(mkDirsList[i]);84 }85 }86 resolve();87});88// Get list of vendors89tasks.push(function (resolve, reject) {90 console.log("Prepare vendor list");91 var list = fs.readdirSync('src/vendor')92 list.forEach(function(file) {93 var vendor = file;94 file = 'src/vendor/' + file95 var stat = fs.statSync(file)96 if (stat && stat.isDirectory()) {97 vendors.push(vendor);98 var vendor_dir = dist_dir + '/vendor/' + vendor;99 if(!fs.existsSync(vendor_dir)){100 fs.mkdirSync(vendor_dir); 101 }102 103 }104 });105 console.log("Finish");106 resolve();107});108// Copy cc.js109tasks.push(function (resolve, reject) {110 console.log("Copy cc.js ");111 for(var i in vendors){112 var filename_src = 'src/vendor/' + vendors[i] + '/cc.js';113 var filename_dst = dist_dir + '/vendor/' + vendors[i] + '/cc.js';114 fs.createReadStream(filename_src).pipe(fs.createWriteStream(filename_dst));115 }116 resolve();117});118// Copy vendor/c/images119tasks.push(function (resolve, reject) {120 console.log("Copy vendor/images ");121 for(var i in vendors){122 var images_src = 'src/vendor/' + vendors[i] + '/images/';123 var images_dst = dist_dir + '/vendor/' + vendors[i] + '/images/';124 125 if(fs.existsSync(images_src) && !fs.existsSync(images_dst)){126 fs.mkdirSync(images_dst);127 var list = fs.readdirSync(images_src)128 list.forEach(function(file){129 fs.createReadStream(images_src + file).pipe(fs.createWriteStream(images_dst + file));130 });131 }132 }133 resolve();134});135// Prepare custom translates136tasks.push(function (resolve, reject) {137 console.log("Prepare translates " + version);138 var langs = ['en', 'ko', 'ru', 'it'];139 for(var c in vendors){140 var vendor = vendors[c];141 console.log("Prepare translate files for '" + vendor + "'");142 for(var l in langs){143 var lang = langs[l];144 var outputPath = dist_dir + '/vendor/' + vendor + '/lang/';145 var filename = lang + '.json';146 mkdirp.sync(outputPath);147 var baseJson = jsonfile.readFileSync(__dirname + '/src/lang/' + lang + '.json');148 var pathToVendor = __dirname + '/src/lang/' + vendor + '/' + lang + '.json';149 if (fs.existsSync(pathToVendor)) {150 var vendorJson = jsonfile.readFileSync(pathToVendor);151 for(var t in vendorJson){152 baseJson[t] = vendorJson[t];153 }154 }155 jsonfile.writeFileSync(outputPath + filename, baseJson);156 }157 }158 resolve();159});160// Prepare custom css161tasks.push(function (resolve, reject) {162 console.log("Prepare custom styles " + version);163 for(var i in vendors){164 var vendor = vendors[i];165 var filename = dist_dir + '/vendor/' + vendor + '/cc.min.css';166 var inFile1 = './src/css/skyvr.css';167 var inFile2 = './src/vendor/' + vendor + '/cc.css';168 console.log("Make minifier version from '" + inFile1 + "' and '" + inFile2 + "' to '" + filename + "' ... ");169 var cleancss = new CleanCSS({'rebase': false}).minify([inFile1, inFile2]);170 fs.writeFileSync(filename, cleancss.styles); 171 }172 resolve("OK");173});174//Prepare custom pageloader.css175tasks.push(function (resolve, reject) {176 console.log("Prepare custom pageloader styles " + version);177 for(var i in vendors){178 var vendor = vendors[i];179 var filename = dist_dir + '/vendor/' + vendor + '/pageloader.min.css';180 var inFile1 = './src/css/pageloader.css';181 var inFile2 = './src/vendor/' + vendor + '/pageloader.css';182 console.log("Make minifier version from '" + inFile1 + "' and '" + inFile2 + "' to '" + filename + "' ... ");183 var cleancss = new CleanCSS({'rebase': false}).minify([inFile1, inFile2]);184 fs.writeFileSync(filename, cleancss.styles); 185 }186 resolve("OK");187});188// Build minifier version for js189var jsScriptsForMinifier = []190jsScriptsForMinifier.push({src: ['src/js/CloudAPI.js'], dst: dist_dir + '/js/CloudAPI.min.js'});191jsScriptsForMinifier.push({src: ['src/js/CloudUI.js'], dst: dist_dir + '/js/CloudUI.min.js'});192jsScriptsForMinifier.push({src: ['src/js/CloudUI.plugin.CamerasList3x2.js'], dst: dist_dir + '/js/CloudUI.plugin.CamerasList3x2.min.js'});193jsScriptsForMinifier.push({src: ['src/js/videojs-contrib-hls-5.3.3.js'], dst: dist_dir + '/js/videojs-contrib-hls-5.3.3.min.js'});194jsScriptsForMinifier.push({src: [195 'src/js/P2PProvider.js',196 'src/js/Calendar.js',197 'src/js/CameraSettings.js',198 'src/js/ThumbnailsList.js',199 'src/js/TimelineLoader.js',200 'src/js/TimelineLoader.js',201 'src/js/CloudPlayer.js',202 'src/js/AndroidRTMPPlayer.js',203 'src/js/scheduler24hours.js',204 'src/js/audio-streaming.js'205], dst: dist_dir + '/js/vxg-vmanager.min.js'});206// jsScriptsForMinifier.push({src: ['src/js/Calendar.js'], dst: dist_dir + '/js/Calendar.min.js'});207// jsScriptsForMinifier.push({src: ['src/js/CameraSettings.js'], dst: dist_dir + '/js/CameraSettings.min.js'});208// jsScriptsForMinifier.push({src: ['src/js/CloudPlayer.js'], dst: dist_dir + '/js/CloudPlayer.min.js'});209tasks.push(function (resolve, reject) {210 for(var i in jsScriptsForMinifier){211 var filename_src = jsScriptsForMinifier[i].src;212 var filename_dst = jsScriptsForMinifier[i].dst;213 console.log("Minifier js-file from '" + filename_src + "' to '" + filename_dst + "' ... ");214 var result = UglifyJS.minify(filename_src);215 fs.writeFileSync(filename_dst, result.code);216 }217 resolve("OK");218});219// Just copy js220var jsCopy = []221jsCopy.push({src: 'src/js/pageloader.js', dst: dist_dir + '/js/pageloader.js'});222jsCopy.push({src: 'src/js/iframe.js', dst: dist_dir + '/js/iframe.js'});223jsCopy.push({src: 'src/js/scheduler24hours.js', dst: dist_dir + '/js/scheduler24hours.js'});224jsCopy.push({src: 'src/js/clips_datetimepicker.js', dst: dist_dir + '/js/clips_datetimepicker.js'});225jsCopy.push({src: 'src/js/ifvisible.js', dst: dist_dir + '/js/ifvisible.js'});226jsCopy.push({src: 'src/js/skyui.js', dst: dist_dir + '/js/skyui.js'});227jsCopy.push({src: 'src/js/videojs.thumbnails.js', dst: dist_dir + '/js/videojs.thumbnails.js'});228// jsCopy.push({src: 'src/js/AndroidRTMPPlayer.js', dst: dist_dir + '/js/AndroidRTMPPlayer.js'});229jsCopy.push({src: 'src/js/oauth.js', dst: dist_dir + '/js/oauth.js'});230// jsCopy.push({src: 'src/js/ThumbnailsList.js', dst: dist_dir + '/js/ThumbnailsList.js'});231// jsCopy.push({src: 'src/js/audio-streaming.js', dst: dist_dir + '/js/audio-streaming.js'});232// jsCopy.push({src: 'src/js/TimelineLoader.js', dst: dist_dir + '/js/TimelineLoader.js'});233jsCopy.push({src: 'src/js/videojs-5.18.3.min.js', dst: dist_dir + '/js/videojs-5.18.3.min.js'});234jsCopy.push({src: 'src/files/template-loader.js', dst: dist_dir + '/files/template-loader.js'});235jsCopy.push({src: 'src/files/js/app.js', dst: dist_dir + '/files/js/app.js'});236jsCopy.push({src: 'src/files/js/common.js', dst: dist_dir + '/files/js/common.js'});237jsCopy.push({src: 'src/files/js/is.min.js', dst: dist_dir + '/files/js/is.min.js'});238jsCopy.push({src: 'src/files/js/lib/arcticmodal.js', dst: dist_dir + '/files/js/lib/arcticmodal.js'});239jsCopy.push({src: 'src/files/js/lib/backbone.babysitter.js', dst: dist_dir + '/files/js/lib/backbone.babysitter.js'});240jsCopy.push({src: 'src/files/js/lib/backbone.js', dst: dist_dir + '/files/js/lib/backbone.js'});241jsCopy.push({src: 'src/files/js/lib/backbone.wreqr.js', dst: dist_dir + '/files/js/lib/backbone.wreqr.js'});242jsCopy.push({src: 'src/files/js/lib/config.js', dst: dist_dir + '/files/js/lib/config.js'});243jsCopy.push({src: 'src/files/js/lib/d3.js', dst: dist_dir + '/files/js/lib/d3.js'});244jsCopy.push({src: 'src/files/js/lib/is.js', dst: dist_dir + '/files/js/lib/is.js'});245jsCopy.push({src: 'src/files/js/lib/jquery.cookie.js', dst: dist_dir + '/files/js/lib/jquery.cookie.js'});246jsCopy.push({src: 'src/files/js/lib/jquery.js', dst: dist_dir + '/files/js/lib/jquery.js'});247jsCopy.push({src: 'src/files/js/lib/jquery-ui.js', dst: dist_dir + '/files/js/lib/jquery-ui.js'});248jsCopy.push({src: 'src/files/js/lib/json2.js', dst: dist_dir + '/files/js/lib/json2.js'});249jsCopy.push({src: 'src/files/js/lib/lodash.js', dst: dist_dir + '/files/js/lib/lodash.js'});250jsCopy.push({src: 'src/files/js/lib/marionette.js', dst: dist_dir + '/files/js/lib/marionette.js'});251jsCopy.push({src: 'src/files/js/lib/moment.js', dst: dist_dir + '/files/js/lib/moment.js'});252jsCopy.push({src: 'src/files/js/lib/moment-timezone.js', dst: dist_dir + '/files/js/lib/moment-timezone.js'});253jsCopy.push({src: 'src/files/js/lib/player.js', dst: dist_dir + '/files/js/lib/player.js'});254jsCopy.push({src: 'src/files/js/lib/polyglot.js', dst: dist_dir + '/files/js/lib/polyglot.js'});255jsCopy.push({src: 'src/files/js/lib/raphael.js', dst: dist_dir + '/files/js/lib/raphael.js'});256jsCopy.push({src: 'src/files/js/lib/raphael-min.js', dst: dist_dir + '/files/js/lib/raphael-min.js'});257jsCopy.push({src: 'src/files/js/lib/require.js', dst: dist_dir + '/files/js/lib/require.js'});258jsCopy.push({src: 'src/files/js/lib/timeline.js', dst: dist_dir + '/files/js/lib/timeline.js'});259jsCopy.push({src: 'src/files/js/lib/timezonejs.js', dst: dist_dir + '/files/js/lib/timezonejs.js'});260jsCopy.push({src: 'src/files/js/lib/underscore.js', dst: dist_dir + '/files/js/lib/underscore.js'});261jsCopy.push({src: 'src/files/js/lib/video.js', dst: dist_dir + '/files/js/lib/video.js'});262jsCopy.push({src: 'src/files/js/app/main1.js', dst: dist_dir + '/files/js/app/main1.js'});263jsCopy.push({src: 'src/files/js/app/views/md_zones_view.js', dst: dist_dir + '/files/js/app/views/md_zones_view.js'});264jsCopy.push({src: 'src/files/js/app/views/camera_settings_view.js', dst: dist_dir + '/files/js/app/views/camera_settings_view.js'});265jsCopy.push({src: 'src/files/js/app/controllers/md_zones_controller.js', dst: dist_dir + '/files/js/app/controllers/md_zones_controller.js'});266jsCopy.push({src: 'src/files/js/app/controllers/camera_settings_controller.js', dst: dist_dir + '/files/js/app/controllers/camera_settings_controller.js'});267tasks.push(function (resolve, reject) {268 for(var i in jsCopy){269 var filename_src = jsCopy[i].src;270 var filename_dst = jsCopy[i].dst;271 console.log("Copy js-file from '" + filename_src + "' to '" + filename_dst + "' ... ");272 fs.createReadStream(filename_src).pipe(fs.createWriteStream(filename_dst));273 }274 resolve("OK");275});276// CSS minifies277var cssForMinifier = []278cssForMinifier.push({src: [279 'src/css/CloudUI.plugin.CamerasList3x2.css'280], dst: dist_dir + '/css/CloudUI.plugin.CamerasList3x2.min.css'});281cssForMinifier.push({src: [282 'src/css/player-container.css',283 'src/css/CloudUI.css',284 'src/css/fullscreen.css',285 'src/css/player.css',286], dst: dist_dir + '/css/CloudUI.min.css'});287tasks.push(function (resolve, reject) {288 for(var i in cssForMinifier){289 var filename_src = cssForMinifier[i].src;290 var filename_dst = cssForMinifier[i].dst;291 console.log("Minifier css-file from '" + filename_src + "' to '" + filename_dst + "' ... ");292 var cleancss = new CleanCSS({'rebase': false}).minify(filename_src);293 fs.writeFileSync(filename_dst, cleancss.styles);294 }295 resolve("OK");296});297// Just copy css298var cssCopy = []299cssCopy.push({src: 'src/css/iframe.css', dst: dist_dir + '/css/iframe.css'});300cssCopy.push({src: 'src/css/mobile.css', dst: dist_dir + '/css/mobile.css'});301cssCopy.push({src: 'src/css/videojs.thumbnails.css', dst: dist_dir + '/css/videojs.thumbnails.css'});302cssCopy.push({src: 'src/css/video-js502.min.css', dst: dist_dir + '/css/video-js502.min.css'});303cssCopy.push({src: 'src/css/hint-2.4.1.min.css', dst: dist_dir + '/css/hint-2.4.1.min.css'});304cssCopy.push({src: 'src/files/app.css', dst: dist_dir + '/files/app.css'});305cssCopy.push({src: 'src/files/video-js.css', dst: dist_dir + '/files/video-js.css'});306tasks.push(function (resolve, reject) {307 for(var i in cssCopy){308 var filename_src = cssCopy[i].src;309 var filename_dst = cssCopy[i].dst;310 console.log("Copy css-file from '" + filename_src + "' to '" + filename_dst + "' ... ");311 fs.createReadStream(filename_src).pipe(fs.createWriteStream(filename_dst));312 }313 resolve("OK");314});315// replace version in index.html316tasks.push(function (resolve, reject) {317 console.log("Read index.html from 'src/index.html' ... ");318 fs.readFile('src/index.html', 'utf8', function (err,data) {319 if (err) {320 reject(err)321 }else{322 var index_html = data;323 console.log("Replacing in index.html: '%VERSION%' -> '" + version + "'");324 index_html = index_html.replace('%VERSION%', version);325 console.log("Write index.html to 'dist/index.html' ...");326 fs.writeFile('dist/index.html', index_html, function (err) {327 if (err)328 reject(err);329 else330 resolve("OK");331 });332 };333 });334});335// Just copy html336var htmlCopy = [];337htmlCopy.push({src: 'src/vendor/index.html', dst: dist_dir + '/vendor/index.html'});338htmlCopy.push({src: 'src/testhls.html', dst: dist_dir + '/testhls.html'});339htmlCopy.push({src: 'src/favicon.ico', dst: dist_dir + '/favicon.ico'});340tasks.push(function (resolve, reject) {341 for(var i in htmlCopy){342 var filename_src = htmlCopy[i].src;343 var filename_dst = htmlCopy[i].dst;344 console.log("Copy html-file from '" + filename_src + "' to '" + filename_dst + "' ... ");345 fs.createReadStream(filename_src).pipe(fs.createWriteStream(filename_dst));346 }347 resolve("OK");348});349// Just copy files in folders350var filesInFolderCopy = [];351filesInFolderCopy.push("/files/images/");352filesInFolderCopy.push("/files/images/player/");353filesInFolderCopy.push("/files/images/camera_setting/");354filesInFolderCopy.push("/files/fonts/SegoeUIRegular/");355filesInFolderCopy.push("/files/fonts/SegoeUIItalic/");356filesInFolderCopy.push("/files/font/");357filesInFolderCopy.push("/swf/");358filesInFolderCopy.push("/files/tz/");359filesInFolderCopy.push("/images/");360tasks.push(function (resolve, reject) {361 for(var i in filesInFolderCopy){362 var b_path = filesInFolderCopy[i];363 var list = fs.readdirSync('src' + b_path);364 list.forEach(function(file) {365 filename_src = 'src' + b_path + file366 filename_dst = dist_dir + b_path + file367 console.log("Copy file from '" + filename_src + "' to '" + filename_dst + "' ... ");368 var stat = fs.statSync(filename_src)369 if (stat && !stat.isDirectory()) {370 fs.createReadStream(filename_src).pipe(fs.createWriteStream(filename_dst));371 }372 });373 }374 resolve("OK");375});376/*function minifierSVG(filename, callback){377 var xml = fs.readFileSync(filename, 'utf8');378 var pResult = null;379 // know async380 xml2js.parseString(xml, function (err, result) { pResult = result; });381 delete pResult['svg']['$']['xmlns:dc'];382 delete pResult['svg']['$']['xmlns:rdf'];383 delete pResult['svg']['$']['xmlns:inkscape'];384 delete pResult['svg']['$']['xmlns:cc'];385 delete pResult['svg']['$']['xmlns:svg'];386 delete pResult['svg']['$']['xmlns:sodipodi'];387 delete pResult['svg']['$']['inkscape:version'];388 delete pResult['svg']['$']['sodipodi:docname'];389 delete pResult['svg']['metadata'];390 delete pResult['svg']['defs'];391 delete pResult['svg']['sodipodi:namedview'];392 var builder = new xml2js.Builder({'renderOpts': { 'pretty': false, 'indent': '', 'newline': '' }});393 return builder.buildObject(pResult);394}*/395// SVG Minifer396/*tasks.push(function (resolve, reject) {397 var svg_files = [398 { source: './src/images/arrow_bold_left_dark_14x25.svg', target: dist_dir + '/images/arrow_bold_left_dark_14x25.svg'},399 { source: './src/images/arrow_bold_left_white_14x25.svg', target: dist_dir + '/images/arrow_bold_left_white_14x25.svg'},400 { source: './src/images/arrow_bold_right_dark_14x25.svg', target: dist_dir + '/images/arrow_bold_right_dark_14x25.svg'},401 { source: './src/images/arrow_bold_right_white_14x25.svg', target: dist_dir + '/images/arrow_bold_right_white_14x25.svg'},402 ];403 for(var i = 0; i < svg_files.length; i++ ){404 xml = minifierSVG(svg_files[i].source);405 fs.writeFileSync(svg_files[i].target, xml);406 }407 resolve();408});*/409// RUN ALL TASKS410var currentTask = 0;411function runNextTask(){412 var prom = new Promise(tasks[currentTask]);413 prom.then(function(){414 currentTask++;415 if(currentTask < tasks.length) {416 runNextTask();417 }else{418 console.log('Done.');419 }420 },function(err){421 console.log('Fail.\n' + err);422 });423}...

Full Screen

Full Screen

config.gulp.js

Source:config.gulp.js Github

copy

Full Screen

1const SRC_DIR = './src/';2const DIST_DIR = './public/';3let path = {4 jsBuild: {5 src : `${SRC_DIR}assets/js/main.js`,6 dist: `${DIST_DIR}js/`,7 distFileName: 'main.js'8 },9 styleBuild: {10 src : `${SRC_DIR}assets/styles/style.scss`,11 dist: `${DIST_DIR}css/`,12 name: 'style.css',13 uncss: [`${DIST_DIR}index.html`]14 },15 imageBuild: {16 src : `${SRC_DIR}assets/img/**/*.+(jpg|png|gif|svg|webp)`,17 dist: `${DIST_DIR}img/`18 },19 webpBuild: {20 src : `${SRC_DIR}assets/img**/*.+(jpg|png|)`,21 dist: `${SRC_DIR}assets/`22 },23 pugBuild: {24 src : `${SRC_DIR}pages/*.pug`,25 dist: `${DIST_DIR}`26 },27 fontsBuild: {28 src : `${SRC_DIR}assets/fonts/**/*.*`,29 dist: `${DIST_DIR}fonts`30 },31 watch: {32 pug : `${SRC_DIR}**/*.pug`,33 js : `${SRC_DIR}**/*.js`,34 style : `${SRC_DIR}**/*.scss`,35 img : `${SRC_DIR}assets/img/**/*.+(jpg|png|gif|svg|webp)`,36 fonts : `${SRC_DIR}assets/fonts/**/*.*`37 },38 svgSpriteBuild: {39 svgSrcMonocolor : `${SRC_DIR}assets/sprite/svg/monocolor/*.svg`,40 svgNameMonocolor : `${SRC_DIR}assets/sprite/svg/monocolor.svg`,41 svgSrcMulticolor : `${SRC_DIR}assets/sprite/svg/multicolor/*.svg`,42 svgNameMulticolor : `${SRC_DIR}assets/sprite/svg/multicolor.svg`,43 newFileName : `svgSprite.svg`,44 dist : `${DIST_DIR}img/`,45 distFile : `${DIST_DIR}img/svgSprite.svg`46 },47 pngSpriteBuild: {48 src : `${SRC_DIR}assets/sprite/png/*.png`,49 name : `sprite`,50 dist : `${DIST_DIR}img`,51 cssPath : `${SRC_DIR}assets/styles/global/`,52 styleFileName: 'global.sprite',53 processor : 'scss'54 },55 clean: DIST_DIR56};57const serverConfig = {58 server: {59 baseDir: DIST_DIR60 },61 tunnel : true,62 host : 'localhost',63 port : 3000,64 logPrefix: "Frontend_Project"65};...

Full Screen

Full Screen

gulpfile.config.js

Source:gulpfile.config.js Github

copy

Full Screen

1var SRC_DIR = './src/'; //源文件目录2var DIST_DIR = './dist/'; //编译后文件存放的目录3var DIST_FILES = DIST_DIR + '**'; // 目标路径下的所有文件 45var Config = {6 src: SRC_DIR,7 dist: DIST_DIR,8 dist_files: DIST_FILES,9 html: {10 dir: SRC_DIR + 'html',11 src: SRC_DIR + 'html/*.html',12 dist: DIST_DIR + 'html'13 },14 assets: {15 dir: SRC_DIR + 'assets',16 src: SRC_DIR + 'assets/**/**',17 dist: DIST_DIR + 'assets'18 },19 css: {20 dir: SRC_DIR + 'css',21 src: SRC_DIR + 'css/**/*.css',22 dist: DIST_DIR + 'css'23 },24 sass:{25 dir: SRC_DIR + 'sass',26 src: SRC_DIR + 'sass/**/*.scss',27 dist: DIST_DIR + 'css'28 },29 js:{30 dir: SRC_DIR + 'js',31 src: SRC_DIR + 'js/**/*.js',32 dist: DIST_DIR + 'js',33 build_name: 'build.js'34 },35 img: {36 dir: SRC_DIR + 'images',37 src: SRC_DIR + 'images/**/*',38 dist: DIST_DIR + 'images'39 },40}41 ...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var DIST_DIR = path.join(__dirname, 'dist');2var SRC_DIR = path.join(__dirname, 'src');3var config = {4 output: {5 },6 module: {7 {8 query: {9 }10 }11 }12};13module.exports = config;14var path = require('path');15var SRC_DIR = path.join(__dirname, 'src');16var DIST_DIR = path.join(__dirname, 'dist');17module.exports = {18 output: {19 },20 module : {21 {22 query: {23 }24 }25 }26};27var webpack = require('webpack');28module.exports = {29 entry: {30 },31 output: {32 path: path.resolve(__dirname, 'dist')33 },34 new webpack.optimize.CommonsChunkPlugin({35 })36}37var webpack = require('webpack');38module.exports = {39 entry: {40 },41 output: {

Full Screen

Using AI Code Generation

copy

Full Screen

1const webpack = require("webpack");2const path = require("path");3const DIST_DIR = path.resolve(__dirname, "dist");4const SRC_DIR = path.resolve(__dirname, "src");5const config = {6output: {7},8module: {9{10query: {11}12}13}14};15module.exports = config;16"scripts": {17},18{19}20{21"env": {22},23"rules": {24"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],25"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],26"react/forbid-prop-types": [0, { "forbid": ["any"] }],

Full Screen

Using AI Code Generation

copy

Full Screen

1const DIST_DIR = path.join(__dirname, "dist");2const SRC_DIR = path.join(__dirname, "src");3const config = {4 output: {5 },6 module: {7 {8 query: {9 }10 }11 }12};13module.exports = config;14{15}

Full Screen

Using AI Code Generation

copy

Full Screen

1var DIST_DIR = path.join(__dirname, "dist");2var SRC_DIR = path.join(__dirname, "src");3module.exports = {4 output: {5 },6 module: {7 {8 query: {9 }10 }11 }12};13"scripts": {14 },15var path = require("path");16var DIST_DIR = path.join(__dirname, "dist");17var SRC_DIR = path.join(__dirname, "src");18module.exports = {19 output: {20 },21 module: {22 {23 query: {24 }25 }26 }27};28"scripts": {29 },30var path = require("path");31var DIST_DIR = path.join(__dirname, "dist");

Full Screen

Using AI Code Generation

copy

Full Screen

1const path = require('path');2const DIST_DIR = path.join(__dirname, 'dist');3const SRC_DIR = path.join(__dirname, 'src');4module.exports = {5 output: {6 },7 module : {8 {9 query: {10 }11 }12 }13};14{15 "scripts": {16 },17 "devDependencies": {18 }19}20"scripts": {

Full Screen

Using AI Code Generation

copy

Full Screen

1const DIST_DIR = path.join(__dirname, "dist");2const SRC_DIR = path.join(__dirname, "src");3module.exports = {4 output: {5 },6 module: {7 {8 query: {9 }10 }11 }12};13{14 "scripts": {15 },16 "dependencies": {17 },18 "devDependencies": {

Full Screen

Using AI Code Generation

copy

Full Screen

1const DIST_DIR = path.join(__dirname, 'dist');2module.exports = {3 output: {4 },5 module: {6 {7 test: /\.(js|jsx)$/,8 options: {9 }10 },11 {12 }13 },14 resolve: {15 },16 devServer: {17 },18 plugins: [new webpack.HotModuleReplacementPlugin()]19};20{21}

Full Screen

Using AI Code Generation

copy

Full Screen

1var DIST_DIR = __dirname + '/dist';2var webpack = require('webpack');3var webpackConfig = {4 entry: {5 },6 output: {7 },8 module: {9 {10 query: {11 }12 }13 }14};15module.exports = webpackConfig;16var DIST_DIR = __dirname + '/dist';17var webpack = require('webpack');18var webpackConfig = {19 entry: {20 },21 output: {22 },23 module: {24 {25 query: {26 }27 }28 }29};30module.exports = webpackConfig;31var DIST_DIR = __dirname + '/dist';32var webpack = require('webpack');33var webpackConfig = {34 entry: {35 },36 output: {37 },38 module: {39 {40 query: {41 }42 }43 }44};45module.exports = webpackConfig;46var DIST_DIR = __dirname + '/dist';47var webpack = require('webpack');48var webpackConfig = {49 entry: {50 },51 output: {52 },53 module: {54 {55 query: {

Full Screen

Using AI Code Generation

copy

Full Screen

1var DIST_DIR = path.join(__dirname, "dist");2var SRC_DIR = path.join(__dirname, "src");3var config = {4 output: {5 },6 module: {7 {8 query: {9 }10 }11 }12};13module.exports = config;14{15 "scripts": {16 },17 "dependencies": {18 },19 "devDependencies": {20 }21}22import React from "react";23import ReactDOM from "react-dom";24ReactDOM.render(<h1>Hi</h1>, document.getElementById("root"));

Full Screen

Using AI Code Generation

copy

Full Screen

1var DIST_DIR = require('bestiejs').DIST_DIR;2var path = require('path');3var distDir = path.join(__dirname, DIST_DIR);4var DIST_DIR = require('bestiejs').DIST_DIR;5var path = require('path');6var distDir = path.join(__dirname, DIST_DIR);7var DIST_DIR = require('bestiejs').DIST_DIR;8var path = require('path');9var distDir = path.join(__dirname, DIST_DIR);10var DIST_DIR = require('bestiejs').DIST_DIR;11var path = require('path');12var distDir = path.join(__dirname, DIST_DIR);13var DIST_DIR = require('bestiejs').DIST_DIR;14var path = require('path');15var distDir = path.join(__dirname, DIST_DIR);16var DIST_DIR = require('bestiejs').DIST_DIR;17var path = require('path');18var distDir = path.join(__dirname, DIST_DIR);19var DIST_DIR = require('bestiejs').DIST_DIR;20var path = require('path');21var distDir = path.join(__dirname, DIST_DIR);22var DIST_DIR = require('bestiejs').DIST_DIR;23var path = require('path');24var distDir = path.join(__dirname, DIST_DIR);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Best automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful