我正在使用Gulp和Bower将JQuery引入我的项目中.但是,jquery.min.cs文件在预编译文件的末尾有一个SourceMappingURL,我想删除它.
目前我的Gulp只是将原始文件复制到目的地:
gulp.task('jquery', function () {
gulp.src(paths.jquerySrc)
.pipe(gulp.dest(paths.jqueryDest));
});
Run Code Online (Sandbox Code Playgroud)
我找到了很多方法来添加源映射但没有删除.我不想为此重新编译所有的jquery.
您可以尝试以下方法:
const paths = {
jquerySrc: './path/to/src/jquery.css',
jqueryDest: './path/to/dest/'
};
gulp.task('jquery', function () {
gulp.src(paths.jquerySrc)
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(sourcemaps.write('/dev/null', {addComment: false}))
.pipe(gulp.dest(paths.jqueryDest));
});
Run Code Online (Sandbox Code Playgroud)
您也可以尝试strip-source-map-loader软件包。从未使用过,但理论上两者都可能起作用。
| 归档时间: |
|
| 查看次数: |
3972 次 |
| 最近记录: |