Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ES6 self executing import [duplicate]

I have require which executes itself and saves result into variable

var $ = require('gulp-load-plugins')();

I am playing with Babel and trying to figure out how to do this in ES6. Now obviously I could do something like

import gulpLoadPlugins from 'gulp-load-plugins';
const $ = gulpLoadPlugins();

But I was wondering if there is some nice one liner way to do it, like with require.

like image 880
Petr Hurtak Avatar asked Jul 05 '15 09:07

Petr Hurtak


1 Answers

But I was wondering if there is some nice one liner way to do it, like with require.

No there is not.

like image 99
Felix Kling Avatar answered Oct 31 '22 00:10

Felix Kling