diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index 41f4a9467..a1106ba5a 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -43,12 +43,20 @@ class Pipeline { importsList["Embark/EmbarkJS"] = utils.joinPath(fs.dappPath(), ".embark", 'embark.js'); importsList["Embark/web3"] = utils.joinPath(fs.dappPath(), ".embark", 'web3_instance.js'); + importsList["Embark/contracts/SimpleStorage"] = utils.joinPath(fs.dappPath(), ".embark", 'SimpleStorage.js'); self.plugins.getPluginsProperty('imports', 'imports').forEach(function (importObject) { let [importName, importLocation] = importObject; importsList[importName] = importLocation; }); + for (let contractName in contractsJSON) { + let contractCode = self.buildContractJS(contractName); + let filePath = utils.joinPath(fs.dappPath(), ".embark", contractName + '.js'); + fs.writeFileSync(filePath, contractCode); + importsList["Embark/contracts/" + contractName] = filePath; + } + let realCwd; async.waterfall([ @@ -69,13 +77,13 @@ class Pipeline { if (request === utils.joinPath(fs.dappPath(), file.filename)) { callback(); } else { - if (request.indexOf('Embark/contracts/') === 0) { - let contractName = request.split('/')[2]; - let contractCode = self.buildContractJS(contractName); - let filePath = utils.joinPath(fs.dappPath(), ".embark", contractName + '.js'); - fs.writeFileSync(filePath, contractCode); - importsList[request] = filePath; - } + //if (request.indexOf('Embark/contracts/') === 0) { + // let contractName = request.split('/')[2]; + // let contractCode = self.buildContractJS(contractName); + // let filePath = utils.joinPath(fs.dappPath(), ".embark", contractName + '.js'); + // fs.writeFileSync(filePath, contractCode); + // importsList[request] = filePath; + //} callback(null, "amd " + Math.random()); } } diff --git a/test_app/app/js/index.js b/test_app/app/js/index.js index b42711002..a6fac16a5 100644 --- a/test_app/app/js/index.js +++ b/test_app/app/js/index.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import EmbarkJS from 'Embark/EmbarkJS'; -import SimpleStorage from 'Embark/contracts/SimpleStorage'; +//import SimpleStorage from 'Embark/contracts/SimpleStorage'; import Test from 'Embark/contracts/Test'; import Assert from 'Embark/contracts/Assert';