Skip to content

Commit

Permalink
symlink node_modules to fix loader resolve
Browse files Browse the repository at this point in the history
close #10
  • Loading branch information
afc163 committed Nov 23, 2017
1 parent 5899d44 commit 96d16f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = function (args, callback) {
"name": "roadhog-api-doc-boilerplate",
"private": true,
"scripts": {
"build": "${isWindows() ? `node ./win-build.js` : `../node_modules/.bin/roadhog build`}"
"build": "${isWindows() ? `node ./win-build.js` : `./node_modules/.bin/roadhog build`}"
},
"dependencies": {},
"devDependencies": {}
Expand All @@ -74,6 +74,7 @@ module.exports = function (args, callback) {

// 4. 启动 roadhog
process.chdir('_roadhog-api-doc');
shelljs.ln('-sf', '../node_modules', 'node_modules');
shelljs.exec('npm run build', function (code, stdout, stderr) {
fs.copySync(path.join(tempDir, './dist/'), path.join(cwd, './dist/'), { overwrite: true });
fs.removeSync(tempDir);
Expand Down

0 comments on commit 96d16f6

Please sign in to comment.