strip-modules-names-loader

0.0.1 • Public • Published

Strip modules names loader

Webpack loader for stripping names from ES6 modules.

Loader has the same purpose as add-module-exports plugin. It removes modules names from exports. Plugin will affect all the imports, but loader could be used to separately for specific files.

It is advised to have only one default export If you have several named exports from file all of them will be ignored.

Example

Existing file

export default {
  a: 1,
  b: true
}
 
const c = {c: 2}
export {
  c
}

Normal Babel v6 modules output

exports.default = {
  a: 1,
  b: true
};
exports.c = c;

Loader modules output

module.exports = {
  a: 1,
  b: true
};
exports.c = c;

Readme

Keywords

none

Package Sidebar

Install

npm i strip-modules-names-loader

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • komlev