Skip to content

Commit a385be6

Browse files
committed
init commit
0 parents  commit a385be6

File tree

8 files changed

+141
-0
lines changed

8 files changed

+141
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["env"]
3+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
node_modules/

app/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('App working: open app/index.js to start exploring ES6');

dev_server.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var express = require('express');
2+
var webpackDevMiddleware = require('webpack-dev-middleware');
3+
var webpack = require('webpack');
4+
var webpackConfig = require('./webpack.config');
5+
var path = require('path');
6+
var PORT = 3000;
7+
8+
var app = express();
9+
var compiler = webpack(webpackConfig);
10+
11+
app.use(webpackDevMiddleware(compiler, {
12+
publicPath: '/dist',
13+
historyApiFallback: true,
14+
quiet: false,
15+
noInfo: false,
16+
stats: {
17+
assets: false,
18+
colors: true,
19+
version: false,
20+
hash: false,
21+
timings: false,
22+
chunks: false,
23+
chunkModules: false
24+
}
25+
}));
26+
27+
app.get('*', function(req, res){
28+
res.sendFile(path.resolve(__dirname, 'index.html'));
29+
});
30+
31+
app.listen(PORT, function(){
32+
console.log('\x1b[36m%s\x1b[33m%s\x1b[0m', 'Dev server running at ', 'localhost:' + PORT);
33+
console.log('\x1b[32m%s\x1b[0m', '\nwebpack: compiling...');
34+
});

index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>ES6 Playground</title>
8+
</head>
9+
<body>
10+
<h1>ES6 Playground</h1>
11+
<div id="root"></div>
12+
<script src="dist/bundle.js"></script>
13+
</body>
14+
</html>

npm-debug.log

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
0 info it worked if it ends with ok
2+
1 verbose cli [ '/Users/Scott/.nvm/versions/node/v7.5.0/bin/node',
3+
1 verbose cli '/Users/Scott/.nvm/versions/node/v7.5.0/bin/npm',
4+
1 verbose cli 'start' ]
5+
2 info using npm@4.1.2
6+
3 info using node@v7.5.0
7+
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
8+
5 info lifecycle es6_playground@1.0.0~prestart: es6_playground@1.0.0
9+
6 silly lifecycle es6_playground@1.0.0~prestart: no script for prestart, continuing
10+
7 info lifecycle es6_playground@1.0.0~start: es6_playground@1.0.0
11+
8 verbose lifecycle es6_playground@1.0.0~start: unsafe-perm in lifecycle true
12+
9 verbose lifecycle es6_playground@1.0.0~start: PATH: /Users/Scott/.nvm/versions/node/v7.5.0/lib/node_modules/npm/bin/node-gyp-bin:/Applications/MAMP/htdocs/resources/es6_playground/node_modules/.bin:/Applications/MAMP/htdocs/idFan/node-test/y/google-cloud-sdk/bin:/Users/Scott/.nvm/versions/node/v7.5.0/bin:~/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
13+
10 verbose lifecycle es6_playground@1.0.0~start: CWD: /Applications/MAMP/htdocs/resources/es6_playground
14+
11 silly lifecycle es6_playground@1.0.0~start: Args: [ '-c', 'node dev_server.js' ]
15+
12 silly lifecycle es6_playground@1.0.0~start: Returned: code: 1 signal: null
16+
13 info lifecycle es6_playground@1.0.0~start: Failed to exec start script
17+
14 verbose stack Error: es6_playground@1.0.0 start: `node dev_server.js`
18+
14 verbose stack Exit status 1
19+
14 verbose stack at EventEmitter.<anonymous> (/Users/Scott/.nvm/versions/node/v7.5.0/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
20+
14 verbose stack at emitTwo (events.js:106:13)
21+
14 verbose stack at EventEmitter.emit (events.js:192:7)
22+
14 verbose stack at ChildProcess.<anonymous> (/Users/Scott/.nvm/versions/node/v7.5.0/lib/node_modules/npm/lib/utils/spawn.js:40:14)
23+
14 verbose stack at emitTwo (events.js:106:13)
24+
14 verbose stack at ChildProcess.emit (events.js:192:7)
25+
14 verbose stack at maybeClose (internal/child_process.js:890:16)
26+
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
27+
15 verbose pkgid es6_playground@1.0.0
28+
16 verbose cwd /Applications/MAMP/htdocs/resources/es6_playground
29+
17 error Darwin 16.5.0
30+
18 error argv "/Users/Scott/.nvm/versions/node/v7.5.0/bin/node" "/Users/Scott/.nvm/versions/node/v7.5.0/bin/npm" "start"
31+
19 error node v7.5.0
32+
20 error npm v4.1.2
33+
21 error code ELIFECYCLE
34+
22 error es6_playground@1.0.0 start: `node dev_server.js`
35+
22 error Exit status 1
36+
23 error Failed at the es6_playground@1.0.0 start script 'node dev_server.js'.
37+
23 error Make sure you have the latest version of node.js and npm installed.
38+
23 error If you do, this is most likely a problem with the es6_playground package,
39+
23 error not with npm itself.
40+
23 error Tell the author that this fails on your system:
41+
23 error node dev_server.js
42+
23 error You can get information on how to open an issue for this project with:
43+
23 error npm bugs es6_playground
44+
23 error Or if that isn't available, you can get their info via:
45+
23 error npm owner ls es6_playground
46+
23 error There is likely additional logging output above.
47+
24 verbose exit [ 1, true ]

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "es6_playground",
3+
"version": "1.0.0",
4+
"description": "An environment set up to aid in testing and learning ES6",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "node dev_server.js",
8+
"bundle": "webpack --colors --config webpack.config.js",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"author": "Scott Bowler",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"babel-core": "^6.24.1",
15+
"babel-loader": "^7.0.0",
16+
"babel-preset-env": "^1.4.0",
17+
"express": "^4.15.2",
18+
"webpack": "^2.4.1",
19+
"webpack-dev-middleware": "^1.10.2"
20+
},
21+
"dependencies": {}
22+
}

webpack.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
4+
module.exports = {
5+
entry: [
6+
'./app/index.js'
7+
],
8+
devtool: 'inline-source-map',
9+
output: {
10+
filename: 'bundle.js',
11+
path: path.resolve(__dirname, 'dist')
12+
},
13+
module: {
14+
rules: [
15+
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }
16+
]
17+
}
18+
};

0 commit comments

Comments
 (0)