Comments (4)
I don't really know what you're asking? Your code shouldn't get converted. Just minified. const
or let
doesn't get converted to var
and so forth. Also, the file I think you're referring to should be named .uglifyrc
and not .unifyrc
unless you changed it in settings.
from es6-css-minify.
Sorry, yes uglifyrc.
Here you are one example:
const CACHE = 'v1';
self.addEventListener('install', event => {
self.skipWaiting();
event.waitUntil(
caches.open(CACHE).then(cache => {
return cache.addAll([
'/',
'/manifest.json',
'/fonts/fontello/css/fontello.css'
]);
})
);
});
self.addEventListener('fetch', event => {
//Using cacheFirst methodology
event.respondWith(fromCache(event.request));
event.waitUntil(update(event.request));
});
function fromCache(request) {
return caches.open(CACHE).then(cache => {
return cache.match(request).then(matching => {
return matching;
});
});
}
function update(request) {
return caches.open(CACHE).then(cache => {
return fetch(request).then(response => {
return cache.put(request, response);
});
});
}
And this is minified to this:
const CACHE="v1";function fromCache(e){return caches.open(CACHE).then(t=>t.match(e).then(e=>e))}function update(e){return caches.open(CACHE).then(t=>fetch(e).then(n=>t.put(e,n)))}self.addEventListener("install",e=>{self.skipWaiting(),e.waitUntil(caches.open(CACHE).then(e=>e.addAll(["/","/manifest.json","/fonts/fontello/css/fontello.css"])))}),self.addEventListener("fetch",e=>{e.respondWith(fromCache(e.request)),e.waitUntil(update(e.request))});
Ah and yes, you're right, it was my mistake I checked minified code contains functions instead of arrow syntax, but this is ok. By the way, how can I use shorten function names in minified code. For example 'fromCache' should be only 'a'?
from es6-css-minify.
By the way, how can I use shorten function names in minified code. For example 'fromCache' should be only 'a'? That's a setting. I changed the default so that it doesn't mangle them anymore.
from es6-css-minify.
You also asked for the documentation. Here are the sources i use:
clean-css
uglify-es
from es6-css-minify.
Related Issues (20)
- Support for <main> tag HOT 1
- Using @import "base.css" will not re-minify when the base.css file changes with minify on change option
- Allow to keep @import statements in CSS when minifying
- Extension issue HOT 1
- Variables starting with `$` are removed HOT 1
- JSON minifier
- "../" removed from url
- Please provide sample link to .uglifyrc settings HOT 1
- Non utf-8 JS files become utf-8 files
- How to minify javascript as part of tasks.json using Visual Studio Code? ...
- Help wanted - New maintainer(s)! HOT 6
- How to compress folder into one file? HOT 1
- Cant minify js files with logical nullish assignment (??=) HOT 1
- Problem with "#" marked private class properties
- Can't minify logical OR assignments
- Problem with Javascript minimization HOT 1
- how to input regex in setting.json? HOT 2
- Pasting bug
- bug on pseudo classes
- Javascript Nullish coalescing operator (??) not supported HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from es6-css-minify.