Skip to content

Commit aaa0722

Browse files
committed
add babel transpiling and refact build scripts from ES5 to ES6
1 parent 9b14552 commit aaa0722

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

Diff for: .babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"latest"
4+
]
5+
}

Diff for: buildScripts/srcServer.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
var express = require('express');
2-
var path = require('path');
3-
var open = require('open');
1+
import express from 'express';
2+
import path from 'path';
3+
import open from 'open';
44

5-
var port = 3000;
5+
const port = 3000;
66

7-
var app = express();
7+
const app = express();
88

99
app.get('/', function(req, res) {
1010
res.sendFile(path.join(__dirname, '../src/index.html'));

Diff for: buildScripts/startMessage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
var chalk = require('chalk');
1+
import chalk from 'chalk';
22

33
console.log(chalk.green('Starting app in dev mode...'));

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "1.0.0",
44
"description": "JavaScript development environment Pluralsight course by Cory House",
55
"scripts": {
6-
"prestart": "node buildScripts/startMessage.js",
6+
"prestart": "babel-node buildScripts/startMessage.js",
77
"start": "npm-run-all --parallel security-check open:src",
8-
"open:src": "node buildScripts/srcServer.js",
8+
"open:src": "babel-node buildScripts/srcServer.js",
99
"security-check": "nsp check",
1010
"localtunnel": "lt --port 3000",
1111
"share": "npm-rull-all --parallel open:src localtunnel"

0 commit comments

Comments
 (0)