File tree Expand file tree Collapse file tree 6 files changed +68
-15
lines changed Expand file tree Collapse file tree 6 files changed +68
-15
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,10 @@ always be in sync.
2828
2929### Development
3030
31- - ` script/test ` will fire up a karma runner and watch for changes in the
32- specs directory .
33- - ` npm test` will do the same but doesn't watch, just runs the tests.
34- - ` script/build-examples ` does exactly that.
31+ - ` npm start ` runs the dev server to run/develop examples
32+ - ` npm test ` will run the test .
33+ - ` script/ test` same as ` npm test ` but keeps karma running and watches
34+ for changes
3535
3636### Build
3737
Original file line number Diff line number Diff line change 44< link href ="app.css " rel ="stylesheet "/>
55< body >
66< div id ="example "> </ div >
7- < script src ="../global-bundle.js "> </ script >
8- < script src ="app-bundle.js "> </ script >
7+ < script src ="/__build__/shared.js "> </ script >
8+ < script src ="/__build__/basic.js "> </ script >
9+
Original file line number Diff line number Diff line change 1313 "example" : " examples"
1414 },
1515 "scripts" : {
16- "test" : " script/test --browsers Firefox --single-run"
16+ "test" : " script/test --browsers Firefox --single-run" ,
17+ "start" : " script/dev-examples"
1718 },
1819 "authors" : [
1920 " Ryan Florence"
2425 "browserify-shim" : " 3.6.0" ,
2526 "envify" : " 1.2.0" ,
2627 "expect" : " 0.1.1" ,
28+ "jsx-loader" : " 0.11.2" ,
2729 "karma" : " 0.12.16" ,
2830 "karma-browserify" : " ^0.2.1" ,
2931 "karma-chrome-launcher" : " 0.1.4" ,
3537 "react-tap-event-plugin" : " git://github.com/appsforartists/react-tap-event-plugin" ,
3638 "reactify" : " ^0.14.0" ,
3739 "rf-release" : " 0.3.1" ,
38- "uglify-js" : " 2.4.15"
40+ "uglify-js" : " 2.4.15" ,
41+ "webpack-dev-server" : " 1.6.5"
3942 },
4043 "peerDependencies" : {
4144 "react" : " >=0.11.0"
5558 "browserify-shim" : {
5659 "react" : " global:React"
5760 }
58- }
61+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ node_modules/.bin/webpack-dev-server --inline --content-base examples/
3+
Original file line number Diff line number Diff line change 1+ var fs = require ( 'fs' ) ;
2+ var path = require ( 'path' ) ;
3+ var webpack = require ( 'webpack' ) ;
4+
5+ var EXAMPLES_DIR = path . resolve ( __dirname , 'examples' ) ;
6+
7+ function isDirectory ( dir ) {
8+ return fs . lstatSync ( dir ) . isDirectory ( ) ;
9+ }
10+
11+ function buildEntries ( ) {
12+ return fs . readdirSync ( EXAMPLES_DIR ) . reduce ( function ( entries , dir ) {
13+ if ( dir === 'build' )
14+ return entries ;
15+
16+ var isDraft = dir . charAt ( 0 ) === '_' ;
17+
18+ if ( ! isDraft && isDirectory ( path . join ( EXAMPLES_DIR , dir ) ) )
19+ entries [ dir ] = path . join ( EXAMPLES_DIR , dir , 'app.js' ) ;
20+
21+ return entries ;
22+ } , { } ) ;
23+ }
24+
25+ module . exports = {
26+
27+ entry : buildEntries ( ) ,
28+
29+ output : {
30+ filename : '[name].js' ,
31+ chunkFilename : '[id].chunk.js' ,
32+ path : 'examples/__build__' ,
33+ publicPath : '/__build__/'
34+ } ,
35+
36+ module : {
37+ loaders : [
38+ { test : / \. j s $ / , loader : 'jsx-loader?harmony' }
39+ ]
40+ } ,
41+
42+ resolve : {
43+ alias : {
44+ 'react-router' : '../../modules/index'
45+ }
46+ } ,
47+
48+ plugins : [
49+ new webpack . optimize . CommonsChunkPlugin ( 'shared.js' )
50+ ]
51+
52+ } ;
You can’t perform that action at this time.
0 commit comments