summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2016-01-16 14:15:31 +0100
committerVictor Häggqvist <[email protected]>2016-01-16 14:15:31 +0100
commit47b575b89249f34a364b516161cbe1e33df0f3a4 (patch)
treefd387d279d0ce1736af461c4a2f622cc30722230
parent7307889639b68064e642ae65bf98d9856c10922b (diff)
make packaged modules work as expected
-rw-r--r--gulpfile.js30
-rw-r--r--package.json1
2 files changed, 13 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'));
});
diff --git a/package.json b/package.json
index dee91e5..960874a 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"devDependencies": {
"babel-eslint": "^5.0.0-beta6",
"babel-loader": "^6.2.1",
+ "babel-plugin-add-module-exports": "^0.1.3-alpha",
"babel-preset-es2015": "^6.3.13",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",