Open ilearnio opened 5 years ago
@ilearnio, I'm taking this issue. Can I?
There is an alternative way too, instead of using the package.json file. We can use ".module-alias-rc" or something similar like ".babelrc" and ".prettierrc".
Thoughts?
@mfaheemakhtar Sure. That would be great! .module-alias-rc
is also a good idea, it could contain JSON object with aliases
, modulesDirectories
.
It makes sense to move them into "module-alias": { alias, modules } (names alias, modules can be different, just took them from WebPack)
I said this earlier but now I think it would be more clear if the properties would be called aliases
and moduleDirectories
, in both package.json or rc file
Would also be nice to be able to define for different environments in this config
{
"development": {
"aliases": [...]
},
// ...
}
moduleAliases_, _moduleDirectories and any other option starting with underscore is ignored in auto-generated package.json (in app.asar) by electron-builder. I think it is better to use module-alias option, or any options that is not starting with underscore, instead of moduleAliases_.
Related issue: Auto generated package.json does not contain settings starting with undersore
Right now we have
_moduleAliases
and_moduleDirectories
options that we read from package.json. It makes sense to move them into"module-alias": { alias, modules }
(namesalias, modules
can be different, just took them from WebPack https://webpack.js.org/configuration/resolve/)