Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #784 from stealjs/minor
Merge @loader and non-normalized module name changes into master
- Loading branch information
Showing
23 changed files
with
283 additions
and
219 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Whether the node is a plugin that won't be included in the build | ||
* @param {Object} node - A node from the dependency graph | ||
* @return {boolean} | ||
*/ | ||
module.exports = function isPluginExcludedFromBuild(node) { | ||
return Boolean( | ||
node.isPlugin && (!node.value.includeInBuild || node.value.pluginBuilder) | ||
); | ||
}; |
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 was deleted.
Oops, something went wrong.
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,36 @@ | ||
var keys = require("lodash/keys"); | ||
var isPluginExcludedFromBuild = require("../../node/is_plugin_excluded"); | ||
|
||
/** | ||
* Checks whether the @steal node is in the graph | ||
* @param {string} configMain - The configMain module name | ||
* @throws if @steal is found in the graph | ||
*/ | ||
module.exports = function(configMain, graph) { | ||
keys(graph).forEach(function(name) { | ||
var node = graph[name]; | ||
|
||
// the configMain node does depend on @steal/@loader but it won't be | ||
// included in the slim build, we can skip it. Same for plugins that | ||
// will be only be used during the build process. | ||
if (name === configMain || isPluginExcludedFromBuild(node)) { | ||
return; | ||
} | ||
|
||
isAtSteal(name); | ||
node.dependencies.forEach(isAtSteal); | ||
}); | ||
}; | ||
|
||
/** | ||
* Checks whether the module name is @steal | ||
* @param {string} name - The module name to be checked | ||
* @throws if the name is @steal | ||
*/ | ||
function isAtSteal(name) { | ||
if (name === "@steal") { | ||
throw new Error( | ||
`Cannot create slim build. "@steal" module is not supported` | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.