module-alias icon indicating copy to clipboard operation
module-alias copied to clipboard

Add "module-alias" to package.json

Open ilearnio opened this issue 6 years ago • 4 comments

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 } (names alias, modules can be different, just took them from WebPack https://webpack.js.org/configuration/resolve/)

ilearnio avatar Feb 13 '19 11:02 ilearnio

@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 avatar Apr 03 '19 04:04 mfaheemakhtar

@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

ilearnio avatar Apr 03 '19 12:04 ilearnio

Would also be nice to be able to define for different environments in this config

{
    "development": {
        "aliases": [...]
    },
   //  ...
}

theomjones avatar Jun 07 '19 13:06 theomjones

_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

gokberkakdeniz avatar Jul 27 '19 18:07 gokberkakdeniz