Skip to content

Commit

Permalink
Merge pull request #2680 from jd-carroll/master
Browse files Browse the repository at this point in the history
Actually allow plugins to be stored as devDependencies
  • Loading branch information
JLHwung authored Oct 20, 2017
2 parents d5b0f82 + acfe620 commit 5f7f4e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/hexo/load_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ function loadModuleList(ctx) {
// Read package.json and find dependencies
return fs.readFile(packagePath).then(function(content) {
var json = JSON.parse(content);
var deps = json.dependencies || json.devDependencies || {};
var deps = Object.keys(json.dependencies || {});
var devDeps = Object.keys(json.devDependencies || {});

return Object.keys(deps);
return deps.concat(devDeps);
});
}).filter(function(name) {
// Ignore plugins whose name is not started with "hexo-"
Expand Down
1 change: 1 addition & 0 deletions test/scripts/hexo/load_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('Load plugins', () => {
name: 'hexo-site',
version: '0.0.0',
private: true,
dependencies: {},
devDependencies: {}
};

Expand Down

0 comments on commit 5f7f4e3

Please sign in to comment.