@achingbrain/gulp-webpack-sourcemaps 中文文档教程
Gulp Webpack Sourcemaps
将 Webpack 包装成一个流接口(并生成源映射)。
Usage
npm install gulp-webpack-sourcemaps --save-dev
import gulp from 'gulp';
import loadPlugins from 'gulp-load-plugins';
const $ = loadPlugins();
const config = {
// Enable watch mode
watch: true,
// Other Webpack config...
};
// We can safely use read: false
return gulp.src('main.less', { cwd: 'resources/assets/styles/', read: false, })
.pipe($.sourcemaps.init()) // Enable sourcemaps
.pipe($.webpackSourcemaps(config))
.pipe($.sourcemaps.write('./', { includeContent: true }))
.pipe(gulp.dest('public/assets/'));
Gulp Webpack Sourcemaps
Wraps Webpack into a streaming interface (and generates sourcemaps).
Usage
npm install gulp-webpack-sourcemaps --save-dev
import gulp from 'gulp';
import loadPlugins from 'gulp-load-plugins';
const $ = loadPlugins();
const config = {
// Enable watch mode
watch: true,
// Other Webpack config...
};
// We can safely use read: false
return gulp.src('main.less', { cwd: 'resources/assets/styles/', read: false, })
.pipe($.sourcemaps.init()) // Enable sourcemaps
.pipe($.webpackSourcemaps(config))
.pipe($.sourcemaps.write('./', { includeContent: true }))
.pipe(gulp.dest('public/assets/'));