Groups make the internal square code really complex because you needed to be able to generate different files based on the groups key. So you could re-use your base files in a new file without having to re-specify those.
We came up with an alternate solution to this, that would keep our code base lean. Remove groups, in favor of different square.json files for each distribution. In addition to this we will allow a new set of keys in the square.json file:
{
"configuration": {
// if you specify an array in the configuration section we will find those files, and merge the bundle key with this file
// this way can create one "main" file and import it in every square.json file you want. This can be useful for configuration
// etc
"import": ["square.json", "other.json"]
},
"bundle": {
// in addition to configuration option we will now allow strings to be set in the bundle. The key is the filename you want
// import and the value is an `@import` statement that will get the file definition from the supplied `square.json` file.
// this allows you to import single files from other square.json files
"filename.js": "@import square.json"
}
}
The only downside is that it adds more "files" to your project, but so be it.
Groups make the internal square code really complex because you needed to be able to generate different files based on the groups key. So you could re-use your base files in a new file without having to re-specify those.
We came up with an alternate solution to this, that would keep our code base lean. Remove groups, in favor of different square.json files for each distribution. In addition to this we will allow a new set of keys in the square.json file:
The only downside is that it adds more "files" to your project, but so be it.