module.js 388 B

12345678910111213141516171819
  1. "use strict";
  2. /**
  3. *
  4. * Returns an module.rule object that has the babel loader if invoked
  5. *
  6. * @param {Void} _ - void value
  7. * @returns {Function} A callable function that adds the babel-loader with env preset
  8. */
  9. module.exports = _ => {
  10. return {
  11. test: `${new RegExp(/\.js$/)}`,
  12. exclude: "/node_modules/",
  13. loader: "'babel-loader'",
  14. options: {
  15. presets: ["'env'"]
  16. }
  17. };
  18. };