gulp-uglify

gulp-uglify cannot change the name

北战南征 提交于 2019-12-25 06:50:03
问题 I'm using gulp-uglify to minify my code, and there's a thing I would like to change . I have the next gulpfile.js . When I do gulp calendar-uglify I got the compile inside /compile/ directory and with the name calendar.min.js . If I change the name inside uglify and I run again the command, gulp generates the name before again. I mean, it seems that uglify cannot compile the file with the name I wrote. Gulp-uglify allways takes the filename of the concat file. What can I do to change that? TY

Minifying AngularJS application issues

隐身守侯 提交于 2019-12-25 00:25:58
问题 I have an application written in AngularJS and Bootstrap that works perfectly well, but when I tried to minify it I got problems. The index.html of my app is: <!DOCTYPE html> <html lang="es-ES" > <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Vebor Editor</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material

Gulp Uglify Options not applying

主宰稳场 提交于 2019-12-22 06:59:08
问题 Hi I am making a theme for the company i work at and the JS segments will not build properly in uglify. I am trying to use uglify to simply concatenate my files, which works but they output minified and mangled with no comments and i cannot figure out why, below is my gulp task which runs correctly but doesnt output with the options provided gulp.task('js', function() { return gulp.src('./src/js/*.js') .pipe(uglify({ options: { mangle: false, beautify: true, comments: true } })) .pipe(rename(

Gulp-sourcemaps not creating a sourcemap file?

依然范特西╮ 提交于 2019-12-19 06:39:31
问题 I'm trying to get Gulp sourcemaps to write files, but I can't see these files anywhere. If any new files were created in the working tree, I would see them in git status , but nothing no new files to be found. Below is my gulpfile.js var gulp = require('gulp'), sourcemaps = require('gulp-sourcemaps'), minify = require('gulp-minify'), concat = require('gulp-concat'), uglify = require('gulp-uglify'); gulp.task('js', function() { return gulp.src('src/js/**/*.js') .pipe(sourcemaps.init()) .pipe

Uglify throws Parse error

爷,独闯天下 提交于 2019-12-17 18:50:49
问题 When i use gulp-uglify with browserify i get a error events.js:72 throw er; // Unhandled 'error' event ^ Error at new JS_Parse_Error (/home/rkmax/my-project/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:189:18) at js_error (/home/rkmax/my-project/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:197:11) at croak (/home/rkmax/my-project/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:656:9) at token_error (/home/rkmax/my-project/node_modules/gulp-uglify

GulpUglifyError: unable to minify JavaScript (Angular 4)

谁都会走 提交于 2019-12-12 21:53:11
问题 I have a problem with uglify main bundle.js file. This is my gulp scripts: gulp.task("compile", () => { let tsResult = gulp.src("app/**/*.ts") .pipe(sourcemaps.init()) .pipe(tsProject()); return tsResult.js .pipe(sourcemaps.write(".", { sourceRoot: '/app' })) .pipe(concat('bundle.js')) .pipe(gulp.dest('app/_Dist/')); }); gulp.task("minify", ["compile"], function () { return gulp.src(['app/_Dist/bundle.js']) .pipe(concat('bundle.min.js')) .pipe(plumber()) .pipe(uglify()) .on('error', function

How to load minified file in angular 2 using gulp uglify ? (which minifies TYpescript Bundled File)

有些话、适合烂在心里 提交于 2019-12-12 19:22:31
问题 I have a angular 2 application in which typescript compiler options is defined to generate a single outFile which is Scripts1.js and Scripts1.js.map Now in my index.html <script src="Scripts/Script1.js"></script> <script> System.config({ packages: { 'V1/components/main': { format: 'register', defaultExtension: 'js', defaultJSExtensions: true } } }); debugger; //System.import('Scripts/main') System.import('V1/components/main') .then(null, console.error.bind(console)); </script> Which is

exit gulp when build is finished

一个人想着一个人 提交于 2019-12-12 05:28:33
问题 I'm using gulp to minify CSS and JS files. When I run the gulp command gulp build:website1:desktop from a terminal, it finishes successfully but it does not return to the shell prompt, I have to run Ctrl+C to return to the command prompt Here is a what I'm using gulp.task('build:website1:desktop', function () { runSequence( 'website1:desktop:scripts', 'website1:desktop:css'); }) Any ideas How to exit and return to the command prompt without typing Ctrl+C every time? Thank you in advance. 回答1:

minify es2017 with gulp

自古美人都是妖i 提交于 2019-12-12 03:50:23
问题 Hey guys I'm currently using uglify-gulp with babel to minify my js. And it works great with es2015 and es2016. But it breaks if I try to do es2017. Does anyone know any workarounds to minify js that is using the new experimental features in es2017? gulp.src('build/js/bundled/bundle.js') .pipe(babel({ compact: false, presets: ["es2017", "react"], plugins: ["transform-decorators-legacy"], })) .pipe(uglify()) .pipe(gulp.dest('build/js/bundled')); which generates this error GulpUglifyError:

gulp-usemin TypeError: Path must be a string. Received undefined

谁说胖子不能爱 提交于 2019-12-11 09:54:11
问题 I'm using gulp-usemin for minify the javascript files I use in my app, for some reason gulp is not seeing one of my files. I have this in my index.html: <body ng-app="App"> <!--[if lte IE 8]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <div> <ui-view></ui-view> </div> <div class="footer"> <div class="container"> <!-- TODO: add fotter here --> </div> <