Focused Bit (1) [Avatar] Offline
#1
I've been stuck in Section 3 for a while. I simply could not get Browserify to work with Babel 6. So after a couple of hours of research and testing. I finally put together a workflow that works using the latest version of Babel.

To be honest, I'd rather figure out how to work with the current version of Babel anyway. So any related issues I come across along the way while going through this book I'll update my post.


From the shell in the root of your project directory:

$ npm init -y
$ npm install babelify --save-dev
$ nmp install --save-dev @babel/cli
$ npm install --save-dev @babel/core
$ npm install --save-dev @babel/preset-env

//version 7 way of adding Stage 0
$ npm install --save-dev @babel/plugin-proposal-function-bind

//version 7 way of adding legacy decorators
$ npm install --save-dev @babel/plugin-proposal-decorators


Create a .bablerc file in the root of your project.

{
    "presets": [
        "@babel/preset-env"
    ],
    "plugins": [
        "@babel/plugin-proposal-function-bind",
        [
            "@babel/plugin-proposal-decorators",
            {
                "legacy": true
            }
        ]
    ],
    "sourceMaps": "inline"
}


Resources:
https://www.npmjs.com/
https://babeljs.io/docs/en/v7-migration
https://github.com/babel/babel/tree/master/packages/babel-preset-stage-0#babelpreset-stage-0

Cheers

-Anthony Hollis