Skip to content

Commit

Permalink
Add example project
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Conner committed May 23, 2017
1 parent 4b9a7cc commit 1319dd1
Show file tree
Hide file tree
Showing 7 changed files with 4,220 additions and 0 deletions.
26 changes: 26 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache

# OS or Editor folders
.DS_Store
.cache
.project
.settings
.tmproj
nbproject
Thumbs.db

# NPM packages folder.
node_modules/

# Brunch output folder.
public/
28 changes: 28 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Brunch + Babel/ES6

This is a modern JS skeleton for [Brunch](http://brunch.io).

## Installation

Clone this repo manually or use `brunch new dir -s es6`

## Getting started

* Install (if you don't have them):
* [Node.js](http://nodejs.org): `brew install node` on OS X
* [Brunch](http://brunch.io): `npm install -g brunch`
* Brunch plugins and app dependencies: `npm install`
* Run:
* `npm start` — watches the project with continuous rebuild. This will also launch HTTP server with [pushState](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history).
* `npm run build` — builds minified project for production
* Learn:
* `public/` dir is fully auto-generated and served by HTTP server. Write your code in `app/` dir.
* Place static files you want to be copied from `app/assets/` to `public/`.
* [Brunch site](http://brunch.io), [Getting started guide](https://github.com/brunch/brunch-guide#readme)

## ES-next

To use proposed JS features not included into ES6, do this:

* `npm install --save-dev babel-preset-stage-0`
* in `brunch-config.js`, add the preset: `presets: ['latest', 'stage-0']`
16 changes: 16 additions & 0 deletions example/app/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Brunch</title>
<link rel="stylesheet" href="/app.css">
<script src="/vendor.js"></script>
<script src="/app.js"></script>
<script>require('initialize');</script>
</head>
<body>
<div class="brunch">
<a href="http://brunch.io"><img src="http://brunch.io/images/logo.png" alt="Brunch"></a>
<p>Bon Appétit.</p>
</div>
</body>
4 changes: 4 additions & 0 deletions example/app/initialize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
document.addEventListener('DOMContentLoaded', () => {
// do your setup here
console.log('Initialized app');
});
Loading

0 comments on commit 1319dd1

Please sign in to comment.