Skip to content

Instantly share code, notes, and snippets.

@SanthoshVijayabaskar
Last active December 9, 2015 15:36
Show Gist options
  • Select an option

  • Save SanthoshVijayabaskar/613bf3e14a71b8cc64d1 to your computer and use it in GitHub Desktop.

Select an option

Save SanthoshVijayabaskar/613bf3e14a71b8cc64d1 to your computer and use it in GitHub Desktop.
ES6 BoilerPlates

Hello World Program 🙏

STEP 1: Setup Babel CommandLine Utility [https://babeljs.io/docs/setup/]
``` npm install -g babel-cli ```
STEP 2: Install Babel Preset for ES2015
``` npm install babel-preset-es2015 ```
STEP 3: Create .babelrc File
``` { "presets": [ "es2015" ] } ```
STEP 4: Create Project Structure
``` -dist -src - main.js -index.html ```
STEP 5: index.html
``` html <title>ES6 Hello World</title>

Welcome to Getting Started with JavaScript 6 Webinar

	<script src="dist/main.js"></script>
</body>
```
STEP 6: main.js
``` javascript let greeting = `hello world`; console.log(greeting); ```
STEP 7: Run the Babel Transpilation and Check the Output
``` babel src --out-dir dist --source-maps ```

Why Source-Maps? Demo: http://www.thecssninja.com/demo/source_mapping/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment