modern-dev / grunt-iife Goto Github PK
View Code? Open in Web Editor NEW:clamp: A Grunt plugin for wrapping JavaScript code in IIFEs.
Home Page: https://www.npmjs.com/package/grunt-iife
License: MIT License
:clamp: A Grunt plugin for wrapping JavaScript code in IIFEs.
Home Page: https://www.npmjs.com/package/grunt-iife
License: MIT License
Hello @virtyaluk, you have a nice plugin here, congrats. I get small issue with grunt.file.exist
, I did a research and I finding in http://gruntjs.com/api/grunt.file and the correct function is grunt.file.exists
.
But I not know if this issue is because the version of grunt.
grunt iife
Running "iife:dist" (iife) task
Warning: grunt.file.exist is not a function Use --force to continue.
See my module:
module.exports = {
dist: {
files: {
'./src/scripts/chip.js': './dist/scripts/chip.js'
}
}
};
You can tell me where I mistake?
Hello again, the result is great but not indented, the linters show errors with the indentation.
;(function() {
'use strict';
/**
* Chip
*/
angular
.module('xx.chip', [
'ngSanitize'
]);
...
}());
Try check with JSHint, ESLint, JSCS...
First of all thanks for the great Grunt plugin! We have been using it in many projects.
We currently require to modify the output manually to achieve better compression. For example, it is possible to create a IIFE using !function(){}()
which would save some extra bytes.
If you would ever want to improve the plugin, I hereby want to suggest to add a compression
option including unary_operator
option.
!function(){ /* code */ }(); // returns true by default
~function(){ /* code */ }(); // returns -1 by default
-function(){ /* code */ }(); // returns NaN by default
+function(){ /* code */ }(); // returns NaN by default
More IIFE techniques are available on https://digitalfortress.tech/js/exclamation-mark-function-iife/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.