Skip to content

Commit b256118

Browse files
committed
Copy static files from the build to the dist folder
1 parent 0219141 commit b256118

File tree

2 files changed

+21
-30
lines changed

2 files changed

+21
-30
lines changed

bit-docs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ module.exports = function(bitDocs){
3030
siteConfig.html = {
3131
dependencies: {},
3232
static: [],
33-
templates: []
33+
templates: [],
34+
staticDist: []
3435
};
3536
}
3637
var html = siteConfig.html;
3738
_.assign(html.dependencies, htmlConfig.dependencies || {});
38-
39+
mergeOnto("staticDist", html, htmlConfig);
3940
mergeOnto("static", html, htmlConfig);
4041
mergeOnto("templates", html, htmlConfig);
4142
});

site/default/static/build.js

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
var stealTools = require("steal-tools"),
32
fsx = require('../../../../fs_extras'),
43
Q = require('q'),
@@ -16,46 +15,37 @@ module.exports = function(options, folders){
1615
});
1716
});
1817
};
18+
19+
var staticDistPromises = [];
20+
options.html.staticDist.forEach(function(dist){
21+
staticDistPromises.push(fsx.copy(dist, path.join(folders.dist)));
22+
});
23+
1924
if(options.devBuild) {
2025
// copy all dependencies
2126
var promise = Q.all([
2227
fsx.copy(path.join(folders.build), path.join(folders.dist) )
23-
]);
28+
].concat(staticDistPromises));
2429
// copy everything and steal.js
2530
return promise;
2631
} else {
2732

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+
});
3744
}).then(function(){
3845
if(options.debug) {
3946
console.log("BUILD: Copying build to dist.");
4047
}
4148
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-
5649
});
5750
}
58-
59-
60-
6151
};

0 commit comments

Comments
 (0)