gulp-uglify

Gulp error with angular2

荒凉一梦 提交于 2020-03-06 04:21:52
问题 I am having an error while deploying an angular project using .gulp at .netCore Package.json "dependencies": { "@angular/common": "~2.1.0", "@angular/compiler": "~2.1.0", "@angular/core": "~2.1.0", "@angular/forms": "~2.1.0", "@angular/http": "~2.1.0", "@angular/platform-browser": "~2.1.0", "@angular/platform-browser-dynamic": "~2.1.0", "@angular/router": "~3.1.0", "@angular/upgrade": "~2.1.0", "@angular/angular-in-memory-web-api": "~0.1.5", "@angular/angular-cli": "1.0.0-beta.19-3". ... }

Gulp error with angular2

♀尐吖头ヾ 提交于 2020-03-06 04:20:13
问题 I am having an error while deploying an angular project using .gulp at .netCore Package.json "dependencies": { "@angular/common": "~2.1.0", "@angular/compiler": "~2.1.0", "@angular/core": "~2.1.0", "@angular/forms": "~2.1.0", "@angular/http": "~2.1.0", "@angular/platform-browser": "~2.1.0", "@angular/platform-browser-dynamic": "~2.1.0", "@angular/router": "~3.1.0", "@angular/upgrade": "~2.1.0", "@angular/angular-in-memory-web-api": "~0.1.5", "@angular/angular-cli": "1.0.0-beta.19-3". ... }

Debugging variables not working with gulp sourcemaps + uglify

自作多情 提交于 2020-01-23 08:12:50
问题 I have the following gulp task for bundling javascript: gulp.task('js', function () { return gulp.src(paths.js) .pipe(sourcemaps.init()) .pipe(uglify()) .pipe(concat('bundle.min.js')) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('dist')); }); When I run this in the Chrome dev tools, sourcemaps are found and breakpoints work, but variables can't be debugged . Take this example chunk of angular code: iarApp.config(['$animateProvider', function ($animateProvider) { $animateProvider

Debugging variables not working with gulp sourcemaps + uglify

拜拜、爱过 提交于 2020-01-23 08:12:07
问题 I have the following gulp task for bundling javascript: gulp.task('js', function () { return gulp.src(paths.js) .pipe(sourcemaps.init()) .pipe(uglify()) .pipe(concat('bundle.min.js')) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('dist')); }); When I run this in the Chrome dev tools, sourcemaps are found and breakpoints work, but variables can't be debugged . Take this example chunk of angular code: iarApp.config(['$animateProvider', function ($animateProvider) { $animateProvider

Uglification failed. Unexpected character '`'

一个人想着一个人 提交于 2020-01-22 14:16:44
问题 gulp-uglify is unable to uglify this piece of code: var alertString = `<?xml version="1.0" encoding="UTF-8" ?> <document> <alertTemplate> <title>${title}</title> <description>${description}</description> </alertTemplate> </document>` it complains at the character: `. The character is valid for the apple's JS framework. I can't see anything inside the uglify package to ignore those characters and the text string inside it. Am i missing something from the documentation? 回答1: Gulp-uglify has yet

CSS and JS minification doesn't work with gulp-filter, gulp-csso, gulp-uglify

纵饮孤独 提交于 2020-01-13 20:31:12
问题 I'm working thorough johnpapa's course on automation with Gulp and seem to hit a weird wall: when I'm trying to run the CSS and JS concatenation and minification task it fails to do the minification. This is the task: gulp.task('optimize', ['inject'], function () { var assets = $.useref.assets({searchPath: ''}); var cssFilter = $.filter(['**/*.css'], {restore: true}); var jsFilter = $.filter(['**/*.js'], {restore: true}); return gulp .src(config.indexFile) .pipe($.rename('test.jsp')) .pipe($

Gulp js error notification not showing source of error

拜拜、爱过 提交于 2020-01-07 08:46:10
问题 Everything is setup and working to concatenate and compile my styles and scripts. When an error occurs gulp-notify and gulp-plumber throw the error up as a mac notification and in terminal, and gulp doesn't stop running - which is great :) However, I'm finding that the script errors that are thrown up in terminal are always problems with the compiled file script-dist.js instead of the actual concatenated source file. Error gulp-notify: [JS Error] _PATH_/js/script-dist.js: Unexpected token

A lot of warnings with webpack uglify

*爱你&永不变心* 提交于 2020-01-03 09:07:52
问题 When I'm running webpack uglify plugin and I'm getting a lot of warnings from the stylus loader / css-loader. How can I resolve them? The webpack bundles it successfully. Condition always true [./~/style-loader!./~/css-loader!./~/stylus-loader!./app/<filename>.styl:10,0] 回答1: That's normal -- by default Uglify tells you about the dead code that it strips out. If you don't want those "warnings" output, you can configure the plugin not to: new Webpack.optimize.UglifyJsPlugin({ compress: {

Prepend custom strings to JS files while concatenating

匆匆过客 提交于 2020-01-02 10:05:58
问题 I am trying to migrate our build process to gulp from existing custom bash build script. We concatenate several unminified opensource JS files like bootstrap, lazyload, ... and our own JS files. We uglify each JS file (removing their licenses as well) in an order, prepend custom license text to some of them as required and concatenate to create the output JS file. The custom license text are currently kept as strings in the bash script. How to achieve this in gulp without creating

Prepend custom strings to JS files while concatenating

点点圈 提交于 2020-01-02 10:05:47
问题 I am trying to migrate our build process to gulp from existing custom bash build script. We concatenate several unminified opensource JS files like bootstrap, lazyload, ... and our own JS files. We uglify each JS file (removing their licenses as well) in an order, prepend custom license text to some of them as required and concatenate to create the output JS file. The custom license text are currently kept as strings in the bash script. How to achieve this in gulp without creating