This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH := node_modules/.bin:$(PATH) | |
SHELL := /bin/bash | |
source_files := $(wildcard lib/*.coffee) | |
build_files := $(source_files:%.coffee=build/%.js) | |
template_source := templates/*.handlebars | |
template_js := build/templates.js | |
app_bundle := build/app.js | |
spec_coffee := $(wildcard spec/*.coffee) | |
spec_js := $(spec_coffee:%.coffee=build/%.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"clean": "rimraf dist/*", | |
"prebuild": "npm run clean -s", | |
"build": "npm run build:scripts -s && npm run build:styles -s && npm run build:markup -s", | |
"build:scripts": "browserify -d assets/scripts/main.js -p [minifyify --compressPath . --map main.js.map --output dist/main.js.map] | hashmark -n dist/main.js -s -l 8 -m assets.json 'dist/{name}{hash}{ext}'", | |
"build:styles": "stylus assets/styles/main.styl -m -o dist/ && hashmark -s -l 8 -m assets.json dist/main.css 'dist/{name}{hash}{ext}'", | |
"build:markup": "jade assets/markup/index.jade --obj assets.json -o dist", | |
"test": "karma start --singleRun", | |
"watch": "parallelshell 'npm run watch:test -s' 'npm run watch:build -s'", | |
"watch:test": "karma start", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|- lib | |
|- src | |
| |- index.js | |
| |- index.test.js | |
| | |
|- config | |
| |- webpack.js | |
| | |
|- demo | |
| |- index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
const MyComponent = () => { | |
return ( | |
<div>Hello</div> | |
) | |
} | |
export default MyComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import MyComponent from '../src' | |
import '../style.css' | |
document.addEventListener('DOMContentLoaded', () => { | |
ReactDOM.render( | |
<MyComponent />, | |
document.querySelector('#react-app') | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Demo</title> | |
<script src="bundle.js"></script> | |
</head> | |
<body> | |
<div id="react-app"></div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test-project", | |
"version": "1.0.0", | |
"description": "", | |
"main": "lib/index.js", | |
"author": "", | |
"license": "MIT", | |
"scripts": { | |
"test": "run test" | |
}, |
NewerOlder