A Babel plugin that rewrites require() calls to normalize them (removing extensions and trailing slashes, for example).
npm install babel-plugin-normalize-requires> Normalize AMD require() calls.
In
``javascript`
require('./a-module.js');
Out
`javascript`
require('./a-module');
`sh`
npm install --save-dev babel-plugin-normalize-requires
Add the following to your .babelrc file:
`json`
{
"plugins": ["normalize-requires"]
}
This plugin removes .js and / suffixes from module names used in AMD require() calls.
However, the plugin is smart enough to not remove .js` suffixes when they are part of the npm package name (as opposed to module name).