1
-
2
1
var stealTools = require ( "steal-tools" ) ,
3
2
fsx = require ( '../../../../fs_extras' ) ,
4
3
Q = require ( 'q' ) ,
@@ -16,46 +15,37 @@ module.exports = function(options, folders){
16
15
} ) ;
17
16
} ) ;
18
17
} ;
18
+
19
+ var staticDistPromises = [ ] ;
20
+ options . html . staticDist . forEach ( function ( dist ) {
21
+ staticDistPromises . push ( fsx . copy ( dist , path . join ( folders . dist ) ) ) ;
22
+ } ) ;
23
+
19
24
if ( options . devBuild ) {
20
25
// copy all dependencies
21
26
var promise = Q . all ( [
22
27
fsx . copy ( path . join ( folders . build ) , path . join ( folders . dist ) )
23
- ] ) ;
28
+ ] . concat ( staticDistPromises ) ) ;
24
29
// copy everything and steal.js
25
30
return promise ;
26
31
} else {
27
32
28
- // run steal-tools and then copy things
29
- return stealTools . build ( {
30
- config : __dirname + "/package.json!npm" ,
31
- main : "bit-docs-site/static"
32
- } , {
33
- minify : options . minifyBuild === false ? false : true ,
34
- quiet : options . debug ? false : true ,
35
- debug : options . debug ? true : false ,
36
- bundleAssets : true
33
+ Promise . all ( staticDistPromises ) . then ( function ( ) {
34
+ // run steal-tools and then copy things
35
+ return stealTools . build ( {
36
+ config : __dirname + "/package.json!npm" ,
37
+ main : "bit-docs-site/static"
38
+ } , {
39
+ minify : options . minifyBuild === false ? false : true ,
40
+ quiet : options . debug ? false : true ,
41
+ debug : options . debug ? true : false ,
42
+ bundleAssets : true
43
+ } ) ;
37
44
} ) . then ( function ( ) {
38
45
if ( options . debug ) {
39
46
console . log ( "BUILD: Copying build to dist." ) ;
40
47
}
41
48
return fsx . copy ( path . join ( folders . build , "dist" ) , path . join ( folders . dist ) ) ;
42
- // copy everything to DIST
43
- /*return Q.all([
44
- fsx.mkdirs( path.join(folders.dist,"bundles") ).then(function(){
45
- return fsx.copy(path.join(folders.build,"bundles"), path.join(folders.dist,"bundles") );
46
- }),
47
- fsx.copyFrom(path.join( require.resolve("steal"), "..", "steal.production.js"), path.join(folders.dist,"steal.production.js") ),
48
- fsx.copy( path.join(folders.build,"html5shiv.js"), path.join(folders.dist,"html5shiv.js")),
49
-
50
- copyDir("fonts"),
51
-
52
- copyDir("img"),
53
- copyDir("templates")
54
- ]);*/
55
-
56
49
} ) ;
57
50
}
58
-
59
-
60
-
61
51
} ;
0 commit comments