Gathering detailed insights and metrics for babel-plugin-transform-function-to-arrow
Gathering detailed insights and metrics for babel-plugin-transform-function-to-arrow
npm install babel-plugin-transform-function-to-arrow
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
70 Stars
226 Commits
3 Forks
8 Watching
9 Branches
3 Contributors
Updated on 30 May 2022
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
200%
6
Compared to previous day
Last week
90%
19
Compared to previous week
Last month
-15.5%
49
Compared to previous month
Last year
14.1%
1,231
Compared to previous year
No dependencies detected.
This project is discontinued here and I'm contributing here -
https://github.com/babel/babili
Thanks for your interest !!!
Some tools, babel plugins and presets to minify ES6+ code or whatever code babel understands.
https://boopathi.in/babel-minify/
keep_fnames
, topLevel
, eval
, except
1import minify from 'gulp-babel-minify'; 2 3gulp.task('min', function() { 4 return gulp.src('build/temp/app.bundle.js') 5 .pipe(minify(opts)) 6 .pipe(gulp.dest('build/')); 7})
1import minify from 'babel-minify'; 2minify(inputCode, { 3 conditionals: true, 4 drop_debugger: true 5});
More details here - https://github.com/boopathi/babel-minify/blob/master/packages/babel-minify
This is a preset that uses the default options of babel-minify
WARNING: This might cause some regression, depending on what other plugins and presets you use with this preset - because all the plugins are applied in one pass by default in babel. You can enable the passPerPreset
option in babel, but then all the babel-minify
plugins are still applied in one pass. So, consider using babel-minify
NodeAPI or CLI or Gulp task with the options - plugins: []
and presets: []
to pass your other plugins and presets.
1{ 2 "presets": ["min"], 3 "comments": false, 4 "compact": true, 5 "minified": true 6}
When you bundle your code, remember to split your bundle into multiple packages or at least vendor
and your app
code separately. Usually, the vendor code will be ES5 compatible and UglifyJS does a better job here. And all the code you write is mostly ES6. You may want to ship this ES6 code to browsers. So we can pass this ES6 code via babel using a specific set of plugins applied in some fashion and make it do the optimizations and minification for you.
webpack.config.js
1// webpack.config.js 2module.exports = { 3 entry: { 4 app: './src/app.js' 5 vendor: ['react', 'react-router', 'lodash', 'my-polyfills'] 6 }, 7 output: { 8 path: 'build/webpack', 9 filename: '[name].bundle.js' 10 } 11 plugins: [ 12 new webpack.optimize.CommonsChunkPlugin('vendor') 13 ] 14}
So, this would generate two files - vendor.bundle.js
& app.bundle.js
gulpfile.js
1const uglify = require('gulp-uglify'); 2const minify = require('gulp-babel-minify'); 3const webpack = require('webpack'); 4const config = require('./webpack.config.js'); 5 6gulp.task('webpack', function(cb) { 7 webpack(config, (err, stats) => { 8 if (err) return cb(err); 9 console.log(stats.toString()); 10 cb(); 11 }); 12}); 13 14gulp.task('minify-vendor', ['webpack'], function() { 15 return gulp.src('build/webpack/vendor.bundle.js') 16 .pipe(uglify()) 17 .pipe(gulp.dest('build/minified')); 18}); 19 20gulp.task('minify-app', ['webpack'], function() { 21 return gulp.src('build/webpack/app.bundle.js') 22 .pipe(minify()) 23 .pipe(gulp.dest('build/minified')); 24});
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 2/25 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More