minify

External source maps for minified, transpiled ES6 code with webpack and gulp

谁说我不能喝 提交于 2019-12-31 17:55:14
问题 I'm writing ES6 code and transpile it to ES5 with Babel, then minify with Uglify. All run with webpack via gulp. I would like to use external source maps (to keep filesize as small as possible). The gulp task is pretty basic - all the funky stuff is in the webpack config: var gulp = require("gulp"); var webpack = require("gulp-webpack"); gulp.task("js:es6", function () { return gulp.src(path.join(__dirname, "PTH", "TO", "SRC", "index.js")) .pipe(webpack(require("./webpack.config.js"))) .pipe

What's the difference between concat and uglify and minify?

流过昼夜 提交于 2019-12-31 08:35:21
问题 What's the difference between concat, uglify, and minify tasks in grunt? I set up an uglify task for all of my site's javascript tasks, and it seemed to both minify and concatenate them. Grunt's site has a great description for how to configure each task, but it doesn't seem to explain what each task actually does. 回答1: Concatenation is just appending all of the static files into one large file . Minification is just removing unnecesary whitespace and redundant / optional tokens like curlys

uglify js error unexpected token eof “undefined”

我的梦境 提交于 2019-12-30 17:56:21
问题 So I installed npm using npm install uglify-js I run a command which is: cat file1.js file2.js .. fileN.js | uglifyjs -o files.min.js and I get this error: WARN: ERROR: Unexpected token eof «undefined», expected punc «,» [-:630,15] /usr/local/lib/node_modules/uglify-js/lib/parse.js:199 throw new JS_Parse_Error(message, line, col, pos); ^ Error at new JS_Parse_Error (/usr/local/lib/node_modules/uglify-js/lib/parse.js:185:18) at js_error (/usr/local/lib/node_modules/uglify-js/lib/parse.js:199

AngularJS Service Config value get destroyed on minification

吃可爱长大的小学妹 提交于 2019-12-30 08:02:17
问题 Having some trouble with minification and AngularJS ;-( I found this jsfiddle "loading" extender for HTTP request, through the AngularJS Wiki page. It worked great until i published it, and the minification destroys it. I can't find a way to use "inject" on the config, so im kinda lost about what to do. Original code: angular.module("app.services", []).config(function($httpProvider) { var spinnerFunction; $httpProvider.responseInterceptors.push("myHttpInterceptor"); spinnerFunction = function

AngularJS Service Config value get destroyed on minification

自闭症网瘾萝莉.ら 提交于 2019-12-30 08:01:20
问题 Having some trouble with minification and AngularJS ;-( I found this jsfiddle "loading" extender for HTTP request, through the AngularJS Wiki page. It worked great until i published it, and the minification destroys it. I can't find a way to use "inject" on the config, so im kinda lost about what to do. Original code: angular.module("app.services", []).config(function($httpProvider) { var spinnerFunction; $httpProvider.responseInterceptors.push("myHttpInterceptor"); spinnerFunction = function

How to build a production version of React without minification?

房东的猫 提交于 2019-12-30 04:48:05
问题 Background I've been following more or less the official guide to setup a local dev environment with react and it seems to use create-react-app , which sets up really a lot. Now, if I run npm run build I get a minified version of everything in the build folder. If I, however, run npm start the version NodeJS serves does not seem to have any modifications. But I cannot see these files. Question So either: Can I access the files generated by npm start somewhere? As these seem to be unmodified.

Failed to Generate Signed Apk - An organization slug is required (provide with --org)

不想你离开。 提交于 2019-12-29 08:40:12
问题 After setting up the Sentry.io error tracking I get this error when I try to Generate Signed Apk : Java Compiler error: An organization slug is required (provide with --org) Click on this image and open it to see more details: I cannot understand anything from this one: Process 'command '/var/folders/j4/_fzm1rks3tsc2h3j4l2qbq4w0000gn/T/.sentry-cli1369818638611304938.exe' ' finished with non-zero exit value 1 This is the file address that was raised in error: How can I solve this problem and

Use closure compiler to remove unused parts of jQuery

老子叫甜甜 提交于 2019-12-29 08:29:09
问题 Is it possible to use the closure compiler to remove unused parts of jQuery? I have a script which only uses jQuery's networking (json) functions, and I'd like a minified script which removes everything else. I've tried invoking it with: java -jar compiler.jar --compilation_level=ADVANCED_OPTIMIZATIONS --js=jquery-latest.js --js=my_script.js --js_output_file=out.js But I end up with a file no smaller than the regular minified jQuery source. Edit: I should mention the reason behind this. This

Why do many sites minify CSS and JavaScript but not HTML? [duplicate]

落爺英雄遲暮 提交于 2019-12-29 04:06:25
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Why minify assets and not the markup? I have seen a lot of sites using minified CSS and JavaScript to increase website response time but I have never seen any sites use minified HTML. Why would you not want your HTML to be minified? 回答1: Because if you're doing things properly you're serving HTML gzipped anyway, so the low-hanging fruit of HTML minification - whitespace - isn't all that relevant. There aren't

Why do many sites minify CSS and JavaScript but not HTML? [duplicate]

你说的曾经没有我的故事 提交于 2019-12-29 04:06:06
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Why minify assets and not the markup? I have seen a lot of sites using minified CSS and JavaScript to increase website response time but I have never seen any sites use minified HTML. Why would you not want your HTML to be minified? 回答1: Because if you're doing things properly you're serving HTML gzipped anyway, so the low-hanging fruit of HTML minification - whitespace - isn't all that relevant. There aren't