-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add staticDist option #41
Merged
Merged
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b256118
Copy static files from the build to the dist folder
imaustink ee77b12
Bassics of copy staticDist wroking
imaustink 05cccd4
Added test for copying staticDist
imaustink 97d213e
Fixed source dist path
imaustink 186cc6d
Made staticDist paths relative
imaustink 43a382e
Refactor dedundant code
imaustink 033f45f
Handle relative paths
imaustink 330ee30
Test relative paths
imaustink 02bbb48
Fix test for relative paths
imaustink 1ec6118
Cleanup tests
imaustink a79df01
Prevent errors with undefined prop
imaustink 4d564a6
Default to array not object
imaustink 9020193
Removed cruft
imaustink f6208cf
Pre-release
imaustink ae069d0
0.6.0-pre.0
imaustink 70cb8ae
0.6.0-pre.1
imaustink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
|
||
var stealTools = require("steal-tools"), | ||
fsx = require('../../../../fs_extras'), | ||
Q = require('q'), | ||
path = require("path"); | ||
|
||
var stealTools = require("steal-tools"); | ||
var fsExtra = require('fs-extra'); | ||
var fsx = require('../../../../fs_extras'); | ||
var Q = require('q'); | ||
var path = require("path"); | ||
var copy = Q.denodeify(fsExtra.copy); | ||
|
||
module.exports = function(options, folders){ | ||
|
||
var copyDir = function(name){ | ||
return fsx.mkdirs( path.join(folders.dist,name) ).then(function(){ | ||
return fsx.mkdirs(path.join(folders.dist,name)).then(function(){ | ||
return fsx.exists(path.join(folders.build,name)).then(function(exists){ | ||
if(exists) { | ||
return fsx.copy( path.join(folders.build,name), path.join(folders.dist,name) ); | ||
return fsx.copy(path.join(folders.build,name), path.join(folders.dist,name)); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
var staticDistPromises = []; | ||
if(options.html && options.html.staticDist){ | ||
options.html.staticDist.forEach(function(dist){ | ||
staticDistPromises.push(copy(path.join(process.cwd(), dist), folders.dist)); | ||
}); | ||
} | ||
|
||
if(options.devBuild) { | ||
// copy all dependencies | ||
var promise = Q.all([ | ||
fsx.copy(path.join(folders.build), path.join(folders.dist) ) | ||
]); | ||
fsx.copy(path.join(folders.build), path.join(folders.dist)) | ||
].concat(staticDistPromises)); | ||
// copy everything and steal.js | ||
return promise; | ||
} else { | ||
|
@@ -38,24 +45,12 @@ module.exports = function(options, folders){ | |
if(options.debug) { | ||
console.log("BUILD: Copying build to dist."); | ||
} | ||
return fsx.copy(path.join(folders.build, "dist"), path.join(folders.dist) ); | ||
// copy everything to DIST | ||
/*return Q.all([ | ||
fsx.mkdirs( path.join(folders.dist,"bundles") ).then(function(){ | ||
return fsx.copy(path.join(folders.build,"bundles"), path.join(folders.dist,"bundles") ); | ||
}), | ||
fsx.copyFrom(path.join( require.resolve("steal"), "..", "steal.production.js"), path.join(folders.dist,"steal.production.js") ), | ||
fsx.copy( path.join(folders.build,"html5shiv.js"), path.join(folders.dist,"html5shiv.js")), | ||
|
||
copyDir("fonts"), | ||
|
||
copyDir("img"), | ||
copyDir("templates") | ||
]);*/ | ||
|
||
var promise = Q.all([ | ||
fsx.copy(path.join(folders.build, "dist"), path.join(folders.dist)) | ||
].concat(staticDistPromises)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is duplicated here and in the |
||
|
||
return promise; | ||
}); | ||
} | ||
|
||
|
||
|
||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#TestID { | ||
display: block; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an array of files, folders, or either?