module.exports = {
build: {
//"index.html":"index.html",
//"app.js": [
//"javascripts/app.js"
//],
//"app.css": [
//"stylesheets/app.css"
//],
//"images/": "images/"
},
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
}
}
};
This is my truffle.js config file(the reason I have commented all those lines is that I have not created them yet.)
when I run the truffle build command, I get the following error
Build configuration can no longer be specified as an object. Please see our documentation for an updated list of supported build configurations.
I went through http://truffle.readthedocs.io/en/beta/getting_started/build/ but there it's the same. Version Details-
Truffle v3.4.7 (core: 3.4.7)
Solidity v0.4.13 (solc-js)
The build proceeds with the new config file according to the Truffle version 3 docs.
var DefaultBuilder = require("truffle-default-builder");
module.exports = {
build: new DefaultBuilder({
"index.html":"index.html",
"app.js":[
"javascripts/app.js"]
}),
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
}
}
};
But now I am getting a new error
Compiling ./contracts/ConvertLib.sol...
Compiling ./contracts/MetaCoin.sol...
Compiling ./contracts/Migrations.sol...
Writing artifacts to ./build/contracts
Error: Couldn't find file at .//app/index.html.
at DefaultBuilder.expect (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:281:17)
at /home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:179:15
at /home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:375:13
at iterate (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:262:13)
at Object.async.forEachOfSeries.async.eachOfSeries (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:281:9)
at Object.async.inject.async.foldl.async.reduce (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:374:15)
at DefaultBuilder.process_files (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:173:9)
at DefaultBuilder.process_target (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:224:8)
at /home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:263:10
at /home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:181:20
at iterate (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:262:13)
at Object.async.forEachOfSeries.async.eachOfSeries (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:281:9)
at Object.async.forEachSeries.async.eachSeries (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:214:22)
at DefaultBuilder.process_all_targets (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:262:9)
at DefaultBuilder.build (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:132:8)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:103776:17.
Problem solved. I missed the app directory needed. Thanks.
Best Answer
You are on the old documentation (for truffle v2.x). The new documentation for Truffle v.3.x is here
The migration process between the versions is explained here:
All of that means that the Truffle config file can't contain a build setup anymore. Just remove the
build
part:truffle.js