Skip to content

Instantly share code, notes, and snippets.

@markusklems
Created April 9, 2016 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markusklems/a5e6b896c2a2525dd9de4d47eeb0d7d3 to your computer and use it in GitHub Desktop.
Save markusklems/a5e6b896c2a2525dd9de4d47eeb0d7d3 to your computer and use it in GitHub Desktop.
Gulp task: replace <script src="node_modules/.../filename.js"> with <script src="lib/filename.js">
const replace = require('gulp-replace');
gulp.task('copy:index', ['clean'], function() {
gulp.src(['index.html'])
.pipe(replace(/node_modules(.*)\/(.*).js/g, 'lib/$2.js'))
.pipe(gulp.dest('dist'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment