sails-hook-babel

7.0.0 • Public • Published

sails-hook-babel

npm version Dependency Status

Needs at least Sails version 0.11.0 to work

Sails JS hook to activate ES6/7 Javascript code for your whole sails app, via https://babeljs.io/.

Installation

npm install sails-hook-babel

Usage

Just lift your app as normal, and enjoy the future of Javascript today. To see what is possible, see: https://babeljs.io/docs/en/learn

Configuration

By default, configuration lives in sails.config.babel. The configuration key (babel) can be changed by setting sails.config.hooks['sails-hook-babel'].configKey.

Parameter Type Details
compile ((boolean)) Whether or not sails should compile future JS code. Defaults to true.
polyfill ((boolean)) Whether or not use @babel/polyfill. Defaults to false.
presets ((array)) Which presets to transpile your code with. Defaults to @babel/preset-env.

Also you can use other Babel 7 options.

That’s it!

Package Sidebar

Install

npm i sails-hook-babel

Weekly Downloads

318

Version

7.0.0

License

MIT

Unpacked Size

221 kB

Total Files

6

Last publish

Collaborators

  • dangreen
  • globegitter