Babeljs, please Do not ignore my package

400 Views Asked by At

I would like to have babel transpile my package from within node-modules.

I've read a few issues already of people trying this, but right now it seems it is broken again. It would be good to see if other agreee, or if I am doing something incorrectly.

My code does not yet include my module and as it is, it works with no problems.

running babel-node --ignore '/node_modules/' also has no problems. if i run babel-node --ignore '/node_modules/(?!my-node-module)' I then get the following error.

Error

[HPM] Error occurred while trying to proxy request /search/red from localhost:3000 to http://localhost:9000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
/Users/petermouland/dev/argos/ui-search/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
    throw e;
    ^

Error: Options {"loose":true} passed to /Users/petermouland/dev/argos/ui-search/node_modules/babel-preset-env/lib/index.js which does not accept options. (While processing preset: "/Users/petermouland/dev/argos/ui-search/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/Users/petermouland/dev/argos/ui-search/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/Users/petermouland/dev/argos/ui-search/node_modules/babel-preset-react/lib/index.js")

.babelrc

{
  "sourceMaps": true,
  "presets": ["react", ["env", {
    "targets": {
      "browsers": [
        "safari >= 9",
        "ie 11",
        "last 2 Chrome versions",
        "last 2 Firefox versions",
        "edge 13",
        "ios_saf 9.0-9.2",
        "ie_mob 11",
        "Android >= 4"
      ],
      "node":  "current",
      "debug": false,
      "loose": false,
      "modules": false,
      "useBuiltIns": true
    }
  }]],
  "plugins": [
    "transform-class-properties",
    "transform-object-rest-spread",
    "transform-object-assign"
  ],
  "env": {
    "test": {
      "plugins": [["istanbul", {
        "exclude": ["**/*.spec.js"]
      }]]
    }
  }
}

Is anyone else having this issue, or is there an improvement to the ignore command i should be using?

0

There are 0 best solutions below