local packaging for asset files
This commit is contained in:
parent
e06e7f5593
commit
834c66ffa8
6 changed files with 3689 additions and 27 deletions
26
gulpfile.js
Normal file
26
gulpfile.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Load gulp and gulp-copy
|
||||
var gulp = require('gulp');
|
||||
var copy = require('gulp-copy');
|
||||
|
||||
// Define a task to copy all css and js files from the source directory
|
||||
gulp.task('copy-assets', function() {
|
||||
// Use a glob pattern to select all css and js files in the source directory and its subdirectories
|
||||
return gulp.src([
|
||||
'./node_modules/bootstrap/dist/**/*.+(css|js)',
|
||||
'./node_modules/feather-icons/dist/**/*.+(css|js)',
|
||||
'./node_modules/progress-tracker/src/styles/*.+(css|js)'
|
||||
]) // Specify the base folder as src
|
||||
.pipe(copy('./assets/', { // Copy the files to the assets folder
|
||||
prefix: 3, // Remove the src folder from the path
|
||||
rename: function(path) { // Rename the path
|
||||
if (path.extname === '.css') { // If the file is a css file
|
||||
path.dirname = 'css'; // Change the folder name to css
|
||||
} else if (path.extname === '.js') { // If the file is a js file
|
||||
path.dirname = 'js'; // Change the folder name to js
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
// Define a default task that runs the copy-assets task
|
||||
gulp.task('default', gulp.series('copy-assets'));
|
||||
Loading…
Add table
Add a link
Reference in a new issue