@rugal.tu/gulp-initer
v1.3.2
Published
Based on gulp, easy to use gulp for copy/clear npm folders/files
Downloads
326
Readme
Gulp-Initer
Based on gulp Easy to use gulp for copy/clear npm folders/files
How to use:
- Install Gulp-Initer from npm
- Create gulpfile.js
- Include gulp-initer in your gulpfile.js
const Initer = require('@rugal.tu/gulp-initer');
Methods:
WithSourceRoot()
WithTargetRoot()
Set foloder source/target path, if not set the default root directory is used
Default source/target root path is node_modules
and wwwroot/npm
Initer
.WithSourceRoot('node_modules')
.WithTargetRoot('wwwroot/npm');
UseClearTarget()
Enable/Disable clear task, if not set the default is enable true
Initer
.UseClearTarget(true);
Add the folder/file that needs to be copied to the settings You can use these to filter .js .ts .css files:
AddFolder_Js()
AddFolder_Ts()
AddFolder_Css()
Initer
.AddFolder_Js('vue/dist') //copy .js files from 'vue/dist' to 'vue/dist'
.AddFolder_Ts('vue/dist', 'vue') //copy .ts files from 'vue/dist' to 'vue'
.AddFolder_Css('bootstrap/dist');
You can also use AddFolder()
to customize the file types to filter:
AddFolder()
Initer
.AddFolder('bootstrap/dist', null, '*.+(js|css)') // copy .js .css files from 'bootstrap/dist' to 'bootstrap/dist'
.AddFolder('vue/dist', 'vue', '*.+(js|ts)'); // copy .js .ts files from 'vue/dist' to 'vue'
InitTask()
After completing the folder settings, just call InitTask()
to create the task and set the task triggering time in Task Explorer
Initer
.AddFolder('vue/dist')
.InitTask();