Using Babel to only output ngAnnotate and not compile es6

Viewed 15

I have an angularJs application that uses 'ngInject' annotations. I want to do a one time op, to compile these files to include the dependancy injections but not edit any other part of the files like transpile to ES5.

My current .babelrc file contents:

{
   "presets": [],
   "plugins": [["angularjs-annotate", { "explicitOnly" : true}]]
}

using this in the command line: npx babel apps/src/angularJs --out-dir .ajs

Package.json installs

"@babel/cli": "^7.18.10",
"@babel/core": "^7.19.0",
"babel-plugin-angularjs-annotate": "^0.10.0",

The above produces the following error in the terminal: Error: Plugin/Preset files are not allowed to export objects, only functions.

0 Answers
Related