Skip to content

Commit bfdb9fd

Browse files
committed
add tiny-slider.module.js back for compatibility
1 parent 41b1dfb commit bfdb9fd

File tree

2 files changed

+2574
-1
lines changed

2 files changed

+2574
-1
lines changed

gulpfile.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ let libName = 'tiny-slider',
1717
modulePostfix = '.module',
1818
helperIEPostfix = '.helper.ie8',
1919
script = libName + '.js',
20+
moduleScript = libName + modulePostfix + '.js',
2021
helperIEScript = libName + helperIEPostfix + '.js',
2122
testScript = testName + '.js',
2223
sassFile = libName + '.scss',
2324
pathSrc = 'src/',
2425
pathDest = 'dist/',
2526
pathTest = 'tests/js/',
26-
scriptSources = [pathSrc + '**/*.js', '!' + pathSrc + helperIEScript];
27+
scriptSources = [pathSrc + '**/*.js', '!' + pathSrc + moduleScript, '!' + pathSrc + helperIEScript];
2728

2829
function errorlog (error) {
2930
console.error.bind(error);
@@ -88,6 +89,17 @@ gulp.task('editPro', ['script'], function() {
8889
.pipe(gulp.dest(pathDest))
8990
});
9091

92+
gulp.task('makeDevCopy', function() {
93+
return gulp.src(pathSrc + script)
94+
// .pipe($.change(function (content) {
95+
// return content
96+
// .replace('IIFE', 'ES MODULE')
97+
// .replace(/bower_components/g, '..');
98+
// }))
99+
.pipe($.rename({ basename: libName + modulePostfix }))
100+
.pipe(gulp.dest(pathSrc))
101+
});
102+
91103
gulp.task('min', ['editPro'], function () {
92104
return gulp.src(pathDest + '*.js')
93105
.pipe($.sourcemaps.init())
@@ -173,6 +185,7 @@ gulp.task('server', function() {
173185
gulp.watch(pathSrc + sassFile, function (e) {
174186
sassTask(pathSrc + sassFile, pathDest);
175187
});
188+
gulp.watch(pathSrc + script, ['makeDevCopy']);
176189
gulp.watch(scriptSources, ['min']);
177190
gulp.watch(pathSrc + helperIEScript, ['helper-ie8']);
178191
// gulp.watch([pathTest + testScript], ['test']);
@@ -184,6 +197,7 @@ gulp.task('default', [
184197
// 'sass',
185198
// 'min',
186199
// 'helper-ie8',
200+
// 'makeDevCopy',
187201
// 'test',
188202
'server',
189203
]);

0 commit comments

Comments
 (0)