
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
requirejs-es2015
Advanced tools
A RequireJS plugin to load ECMAScript 2015 modules via babel. It depends on babel-core 6.x and comes with the ES2015 preset as well as babel plugin for transforming ES2015 modules to AMD.
For transforming advanced ECMAScript syntax, it uses your projects .babelrc, so you can
choose, which presets and plugins you want to use.
es! prefix.babelrc or babel-config from your package.jsonInstall the package either by using npm or yarn.
npm i -D requirejs-es2015
yarn add -D requirejs-es2015
To make use of the plugin, you want to modify your RequireJS config file, to contain the path to the requirejs-es2015 package as well as an optional file extension that is used by your ES2015 files.
It should look something like this:
requirejs.config({
// ...
paths: {
es: 'node_modules/requirejs-es2015/es'
},
babel: {
fileExtension: '.js' // extension of your ES2015 files - defaults to .js
}
// ...
});
You can now import ES2015 modules in your RequireJS files like this:
define([
'es!myModule',
'es!components/anotherModule'
], function(myModule, anotherModule) {
myModule.method();
anotherModule.test();
});
If you want to use babel-transformations besides the built-in ES2015 preset, you can create a .babelrc
in your projects root directory (if not already present) or use the babel section of your package.json file.
export default syntaxMIT
FAQs
RequireJS plugin to load ES2015 modules via babel.
We found that requirejs-es2015 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.