Convert Gulp task to Webpack Hi,
I'm not sure if this is possible or not but I was wondering if there is a way to go through a file(s) replace a prefix in SCSS & JS. I've seen it done in UIKit v2 but it's in gulp.
I am unsure what you are asking. Do you have a gulp config you wish to setup in webpack so it does the same?
If so you should post the config. Maybe someone can give you some pointers.
If not, then please give an example of what you are trying to accomplish
Yeah I'm wanting to recreate this gulp task in webpack.
gulp.task('prefix', function(done) {
var prefix = gutil.env.p || gutil.env.prefix || false;
if(!prefix) {
return done();
}
gutil.log("Replacing prefix 'uk' with '"+prefix+"'");
gulp.src(['./dist/**/*.css', './dist/**/*.less', './dist/**/*.scss', './dist/**/*.js'])
.pipe(replace(/(uk-([a-z\d\-]+))/g, prefix+'-'))
.pipe(replace(/data-uk-/g, 'data-'+prefix+'-'))
.pipe(replace(/UIkit2/g, 'UIkit2'+prefix))
.pipe(gulp.dest('./dist'))
.on('end', done);
});
Please sign in or create an account to participate in this conversation.