Skip to content

RonnieSan/gulp-importjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-importjs

Gulp plugin for allowing imports in JS files using the @import syntax. Each import MUST be on it's own line. If a script has already been imported on the page, it will not import again. Imports are recursive.

##Usage Create a new js file with a .jsrc extension.

@import "/path/to/file.js";

In your gulpfile.js...

var gulp     = require('gulp');
var importjs = require('gulp-importjs');
var rename   = require('gulp-rename');

gulp.task('importjs', function() {
  return gulp.src(['folder/to/run/importjs/on'])
    .pipe(importjs())
    .pipe(rename({extname: '.js'}))
    .pipe(gulp.dest('folder/to/save/to'));
});

gulp.task('default', ['importjs']);

About

Gulp plugin for allowing imports in JS files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published