diff options
author | Victor Häggqvist <[email protected]> | 2016-01-16 14:15:31 +0100 |
---|---|---|
committer | Victor Häggqvist <[email protected]> | 2016-01-16 14:15:31 +0100 |
commit | 47b575b89249f34a364b516161cbe1e33df0f3a4 (patch) | |
tree | fd387d279d0ce1736af461c4a2f622cc30722230 /gulpfile.js | |
parent | 7307889639b68064e642ae65bf98d9856c10922b (diff) |
make packaged modules work as expected
Diffstat (limited to '')
-rw-r--r-- | gulpfile.js | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/gulpfile.js b/gulpfile.js index 3e1a65a..c081b81 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -22,11 +22,13 @@ var webpackOptions = { ActivityIndicator: './src/Plugins/ActivityIndicator.js', Overlay: './src/Plugins/Overlay.js', CloseButton: './src/Plugins/CloseButton.js', + Captions: './src/Plugins/Captions.js', + Navigation: './src/Plugins/Navigation.js', Core: './src/LightBox.js' }, output: { - filename: "LightBox.[name].js", - library: ["LightBox", "[name]"], + filename: 'LightBox.[name].js', + library: ['LightBox','[name]'], libraryTarget: "var" }, module: { @@ -34,7 +36,8 @@ var webpackOptions = { { loader: 'babel', query: { - presets: ['es2015'] + presets: ['es2015'], + plugins: ['add-module-exports'] } } ] @@ -42,25 +45,16 @@ var webpackOptions = { }; gulp.task('pack', function() { - return gulp.src('').pipe(webpack(webpackOptions)).pipe(gulp.dest('./demo')); - - //return gulp.src(['./src/LightBox.js', './src/Plugins/*.js']) - // .pipe(webpack(webpackOptions)) - // //.pipe(gulp.dest('./dist')); - // .pipe(gulp.dest('./demo')); + return gulp.src('') + .pipe(webpack(webpackOptions)) + .pipe(gulp.dest('./demo')); }); gulp.task('default', ['pack']); gulp.task('watch', function () { - //gulp.watch('./src/LightBox.js', ['pack']) - webpackOptions.watch = true; - - gulp.src('').pipe(webpack(webpackOptions)).pipe(gulp.dest('./demo')); - - //return gulp.src(['./src/LightBox.js', './src/Plugins/*.js']) - // .pipe(webpack(webpackOptions)) - // //.pipe(gulp.dest('./dist')); - // .pipe(gulp.dest('./demo')); + gulp.src('') + .pipe(webpack(webpackOptions)) + .pipe(gulp.dest('./demo')); }); |