Skip to content

Instantly share code, notes, and snippets.

@ferdiemmen
Created February 8, 2018 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferdiemmen/2adf128ce23252abfc25e958541ace9e to your computer and use it in GitHub Desktop.
Save ferdiemmen/2adf128ce23252abfc25e958541ace9e to your computer and use it in GitHub Desktop.
ES6 to ES5 packages
i solved the same issue recently for this module and others like --> ngx translate and more...
solution (compile the js files into es2015):
npm i --save -dev babel-cli babel-preset-es2015
add this to the root project under the name .babelrc
{ "presets": ["es2015"] }
add a npm script in package.json in "scrtipsts" scope
"compile_@agm_core": "babel node_modules/@agm/core -d node_modules/@agm/core --presets es2015",
add a postinstall script in package.json in "scrtipsts" scope
"postinstall": "npm run compile_@agm_core",
run npm i to install the deps. After installing the deps, the script postinstall will run and babel will compile the targeted js files
run your server and should world
Give me please feedback if it works. I did the same thins for more than 3 npm modules it works on my machine :D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment