Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
rollup-plugin-babel
Advanced tools
The rollup-plugin-babel package is a Rollup plugin that allows you to use Babel to transpile your JavaScript code. This is particularly useful for converting ES6+ code into a format that is compatible with older browsers or environments. The plugin integrates seamlessly with Rollup, making it easy to include Babel in your build process.
Transpile ES6+ Code
This feature allows you to transpile ES6+ code to ES5 using Babel. The code sample demonstrates how to set up Rollup with the Babel plugin to transpile code from the 'src/index.js' file and output it to 'dist/bundle.js'.
const babel = require('rollup-plugin-babel');
module.exports = {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'cjs'
},
plugins: [
babel({
exclude: 'node_modules/**'
})
]
};
Custom Babel Configuration
This feature allows you to use a custom Babel configuration. The code sample shows how to specify Babel presets and plugins directly within the Rollup configuration.
const babel = require('rollup-plugin-babel');
module.exports = {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'cjs'
},
plugins: [
babel({
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-transform-runtime']
})
]
};
Exclude Specific Files or Directories
This feature allows you to exclude specific files or directories from being transpiled by Babel. The code sample demonstrates how to exclude all files in the 'node_modules' directory.
const babel = require('rollup-plugin-babel');
module.exports = {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'cjs'
},
plugins: [
babel({
exclude: 'node_modules/**'
})
]
};
The rollup-plugin-typescript2 package is a Rollup plugin that allows you to use TypeScript in your Rollup build process. It offers similar functionality to rollup-plugin-babel but is specifically designed for TypeScript. It also provides better caching and incremental compilation compared to other TypeScript Rollup plugins.
The rollup-plugin-sucrase package is a Rollup plugin that uses Sucrase to transform your code. Sucrase is a faster alternative to Babel for transforming modern JavaScript syntax. While it doesn't support as many transformations as Babel, it can be a good choice for projects that need faster build times.
The rollup-plugin-esbuild package is a Rollup plugin that uses esbuild to transpile JavaScript and TypeScript code. Esbuild is known for its speed and efficiency, making it a good alternative to Babel for projects that prioritize build performance.
2.5.0
babelHelpers
rather than injecting them – allows transform
function to be pure (#rollup/658)FAQs
Seamless integration between Rollup and Babel.
The npm package rollup-plugin-babel receives a total of 309,905 weekly downloads. As such, rollup-plugin-babel popularity was classified as popular.
We found that rollup-plugin-babel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.