Coder Social home page Coder Social logo

gulp-js-import's People

Contributors

nambo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gulp-js-import's Issues

Sourcemaps are not working

Hi,

I've set my compile task like this:

return gulp.src(`src/js/script.js`)
	.pipe(sourcemaps.init())
	.pipe(js_import())
		.on('error', error)
	.pipe(babel({presets: ['es2015']}))
		.on('error', error)
	.pipe(uglify())
		.on('error', error)
	.pipe(rename('script.min.js'))
	.pipe(sourcemaps.write('.'))
	.pipe(gulp.dest('dist'))
	.pipe(livereload());

But when an error occurs (for instance on babel), the error line is related to script.js after importing the js dependencies.

How can I get this to work? I can't debug my app blindly.

Thanks,
Quentin

Wildcard support

Hi,
thanks for this module, I included it in one second :)

I would just ask you if there is or it is planned the possibility to import many modules using a wildcard:

@import './widgets/*.js'

Not importing the same file twice.

I have this in my Gulp file:

gulp.src( scripts )
   .pipe( jsImport( { hideConsole: true } ) )
   .pipe( rename( { suffix: '.min' } ) )
   .pipe( babel({
       presets: ['es2015-script'],
       parserOpts: { sourceType: 'script' }
   }).on('error', function(err) { console.log(err) }) )
   .pipe( uglify() )
   .pipe( gulp.dest( paths.js ) );

2 files:

file1.js:

@import ./base/jsfile1.js

file2.js:

@import ./base/jsfile1.js

And in the minified version of file1.js I get jsfile1.js and in file2.js, I just get:

;

instead of the imported file.

Great package! But can we choose to disable the messages?

I really love this package. It's ultra simple and does exactly what I wanted to do.

I was first going in trouble with browserify, which does complex things for simple purposes.

And with this package, I can now keep my global variables and split all my js in as many files I want.

Now I just want to disable the two console.logs, because I want to keep my console clear.

Is there an option for that?

Commenting

Hy,

Is there a way commenting without consider an actual import the folowing: //@import '.../myscrpt.js' ?

Btw, helpful plugin. Ty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.