File tree 6 files changed +68
-15
lines changed
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.
28
28
29
29
### Development
30
30
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
35
35
36
36
### Build
37
37
Original file line number Diff line number Diff line change 4
4
< link href ="app.css " rel ="stylesheet "/>
5
5
< body >
6
6
< 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 13
13
"example" : " examples"
14
14
},
15
15
"scripts" : {
16
- "test" : " script/test --browsers Firefox --single-run"
16
+ "test" : " script/test --browsers Firefox --single-run" ,
17
+ "start" : " script/dev-examples"
17
18
},
18
19
"authors" : [
19
20
" Ryan Florence"
24
25
"browserify-shim" : " 3.6.0" ,
25
26
"envify" : " 1.2.0" ,
26
27
"expect" : " 0.1.1" ,
28
+ "jsx-loader" : " 0.11.2" ,
27
29
"karma" : " 0.12.16" ,
28
30
"karma-browserify" : " ^0.2.1" ,
29
31
"karma-chrome-launcher" : " 0.1.4" ,
35
37
"react-tap-event-plugin" : " git://github.com/appsforartists/react-tap-event-plugin" ,
36
38
"reactify" : " ^0.14.0" ,
37
39
"rf-release" : " 0.3.1" ,
38
- "uglify-js" : " 2.4.15"
40
+ "uglify-js" : " 2.4.15" ,
41
+ "webpack-dev-server" : " 1.6.5"
39
42
},
40
43
"peerDependencies" : {
41
44
"react" : " >=0.11.0"
55
58
"browserify-shim" : {
56
59
"react" : " global:React"
57
60
}
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