aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src/compiler.ts
diff options
context:
space:
mode:
authorFred Carlsen <fred@sjelfull.no>2018-12-05 23:15:44 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-05 23:15:44 +0800
commit00dbddc1aafd56c352e7a8905338d81e236b1fa1 (patch)
treec8462eb4e6882a39dec601b990f75761b4897ce8 /packages/sol-compiler/src/compiler.ts
parentb552c2bd0c5090629a96bc6b0e032cb85d9c52b3 (diff)
parentb411e2250aed82b87d1cbebf5cf805d794ddbdb7 (diff)
downloaddexon-sol-tools-00dbddc1aafd56c352e7a8905338d81e236b1fa1.tar
dexon-sol-tools-00dbddc1aafd56c352e7a8905338d81e236b1fa1.tar.gz
dexon-sol-tools-00dbddc1aafd56c352e7a8905338d81e236b1fa1.tar.bz2
dexon-sol-tools-00dbddc1aafd56c352e7a8905338d81e236b1fa1.tar.lz
dexon-sol-tools-00dbddc1aafd56c352e7a8905338d81e236b1fa1.tar.xz
dexon-sol-tools-00dbddc1aafd56c352e7a8905338d81e236b1fa1.tar.zst
dexon-sol-tools-00dbddc1aafd56c352e7a8905338d81e236b1fa1.zip
Merge remote-tracking branch 'upstream/development' into website
# Conflicts: # packages/website/package.json # packages/website/ts/style/colors.ts
Diffstat (limited to 'packages/sol-compiler/src/compiler.ts')
-rw-r--r--packages/sol-compiler/src/compiler.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index 8ee7fa4a9..cba67f292 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -394,7 +394,14 @@ export class Compiler {
//
const lastPathSeparatorPos = contractPath.lastIndexOf('/');
const contractFolder = lastPathSeparatorPos === -1 ? '' : contractPath.slice(0, lastPathSeparatorPos + 1);
- importPath = path.resolve('/' + contractFolder, importPath).replace('/', '');
+ if (importPath.startsWith('.')) {
+ /**
+ * Some imports path are relative ("../Token.sol", "./Wallet.sol")
+ * while others are absolute ("Token.sol", "@0x/contracts/Wallet.sol")
+ * And we need to append the base path for relative imports.
+ */
+ importPath = path.resolve('/' + contractFolder, importPath).replace('/', '');
+ }
if (_.isUndefined(sourcesToAppendTo[importPath])) {
sourcesToAppendTo[importPath] = { id: fullSources[importPath].id };