Truffle: Stop generating two config files

Created on 17 Apr 2018  路  10Comments  路  Source: trufflesuite/truffle

I'd like to suggest that we remove the truffle-config.js file from our templates (Truffle boxes and the output of the truffle init command). It was only ever relevant on Windows, and we now have multiple documented workarounds such that it's not necessary.

http://truffleframework.com/docs/advanced/configuration#resolving-naming-conflicts-on-windows

Also, it seems to confuse people, who don't understand why it's there.

I figure that if Truffle continues to accept the existence of a truffle-config.js in projects, but just doesn't ship one with new projects, then we can implement this without any breaking changes.

stale

Most helpful comment

Why not just eliminate truffle.js and only recognize truffle-config.js? Works on all supported OSes.

All 10 comments

Why not just eliminate truffle.js and only recognize truffle-config.js? Works on all supported OSes.

@tomcbean I would be in favor of that direction if there is broad community interest.

I think it's probably the way to go, since it avoids the collision altogether, but I worry about how much it would trip projects up, since truffle.js is so widespread.

Thoughts, any/all?

Or a third option, which is to create a new file name entirely, such as config.js and grandfather everything in. Shorter and non-conflicting.

(I have a small bias against the length and redundancy of truffle-config.js, but I won't push against it if that's what we decide on.)

@bmmpxf I'm not in favor of removing truffle from the name because many projects often have multiple tools' config files in the same directory. There's also a benefit looking at the source for a project, truffle.js immediately indicates that it's a Truffle project, so you know what you're looking at.

@gnidan For sure, makes sense. I am much more in favor of retaining truffle.js anyway.

Two alternative suggestions:

  • truffle/config.js
  • truffle.config.js

Does any of that clashes with Windows?

@axic Both of those would be fine. The conflict is with the truffle.cmd file, the script that runs all of the Truffle commands. On Windows, .js has priority over .cmd by default when the extension isn't specified and both are on the path.

Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.

There has been no new activity on this issue since it was marked as stale 7 days ago, so it is being automatically closed. If you'd like help with this or a different problem, please open a new issue. Thanks!

@gnidan was this solved in the end?

Was this page helpful?
0 / 5 - 0 ratings