Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ecomfe/okam
Browse files Browse the repository at this point in the history
  • Loading branch information
xhong0 committed Feb 14, 2019
2 parents d10af8d + a8783c7 commit 486cea0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog

## 2019-02-14

### [email protected]
* **Bug修复**
* 修复 `okam-core` 依赖安装在项目源码根目录的父级目录依赖处理问题 ([cf16dfd](https://github.com/ecomfe/okam/commit/cf16dfd))

## 2019-02-10

### [email protected]
Expand Down
2 changes: 1 addition & 1 deletion packages/okam-build/lib/build/BuildManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class BuildManager extends EventEmitter {
}

// replace module okam-core/na/index.js content using specified app env module
if (file.path === 'node_modules/okam-core/src/na/index.js') {
if (file.path.indexOf('node_modules/okam-core/src/na/index.js') !== -1) {
let naEnvModuleId = `../${this.appType}/env`;
file.content = `'use strict;'\nexport * from '${naEnvModuleId}';\n`;
this.envFileUpdated = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/okam-build/lib/build/init-build-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function initBuildOptions(appType, options, cliOpts = {}) {
buildConf.server = false;
}

const rootDir = buildConf.root || process.cwd();
const rootDir = path.resolve(process.cwd(), buildConf.root || '.');
buildConf.root = rootDir;

// init output config
Expand Down
7 changes: 5 additions & 2 deletions packages/okam-build/lib/processor/FileFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,15 @@ class FileFactory extends EventEmitter {
return;
}

// considering npm dependencies maybe installed in
// the parent dir of the current project root, so here should remove `../`
const testPath = filePath.replace(/^(\.\.\/)+/, '');
let result;
Object.keys(rebaseDir).some(originalDir => {
let newDir = rebaseDir[originalDir];
if (filePath.indexOf(originalDir) === 0) {
if (testPath.indexOf(originalDir) === 0) {
result = resolveDepModuleNewPath(
filePath, originalDir, newDir
testPath, originalDir, newDir
);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/okam-build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "okam-build",
"version": "0.4.20",
"version": "0.4.21",
"description": "The build tool for Okam develop framework",
"main": "index.js",
"keywords": [
Expand Down

0 comments on commit 486cea0

Please sign in to comment.