Skip to content

Commit

Permalink
fix(md-waves): don't attach when building for amd, ref #238
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanood committed Aug 31, 2016
1 parent 737203e commit 5e084ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ gulp.task('build-commonjs', function () {
});

gulp.task('build-amd', function () {
// RegExp remove tags during insert.transform in build-amd gulp task
var startTag = '//\\s*build-amd-remove start';
var endTag = '//\\s*build-amd-remove end';
var removeAmdRegExp = new RegExp(startTag + '[^]+?' + endTag, 'g');

return gulp.src(paths.source)
// .pipe(to5(assign({}, compilerOptions, {modules:'amd', plugins: []})))
.pipe(insert.transform(function(contents) {
return contents.replace(removeAmdRegExp, '');
}))
.pipe(to5(assign({}, compilerOptions.amd())))
.pipe(gulp.dest(paths.output + 'amd'));
});
Expand Down
2 changes: 2 additions & 0 deletions src/waves/waves.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export class MdWaves {
}

this.attributeManager.addClasses(classes);
// build-amd-remove start
Waves.attach(this.element);
// build-amd-remove end
}

detached() {
Expand Down

0 comments on commit 5e084ec

Please sign in to comment.