brunch / brunch.github.io

The website
https://brunch.io
MIT License
113 stars 99 forks source link

Replace Coffee example by Babel one #232

Closed denysdovhan closed 7 years ago

denysdovhan commented 7 years ago

Let's say you want to try the new fancy ECMAScript thing. Maybe your OCD would be eased by conforming to 66 ESLint rules. It doesn't matter, more than 50 Brunch plugins aim to help with all kinds of crazy cases.

Install Babel plugin by executing npm install --save-dev babel-brunch. Hmm...that's exactly the same command from our previous step. Whatever. Let's create the morning.js file with some content:

$ echo 'console.log(`Good morning, ${process.env.USER}!`)' > app/morning.js

Since you've added Babel plugin to the board, Brunch would magically recompile the app and include compiled content of morning.js in the output file. Voila!