Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "module-alias" to package.json #50

Open
ilearnio opened this issue Feb 13, 2019 · 4 comments · May be fixed by #51
Open

Add "module-alias" to package.json #50

ilearnio opened this issue Feb 13, 2019 · 4 comments · May be fixed by #51

Comments

@ilearnio
Copy link
Owner

@ilearnio ilearnio commented Feb 13, 2019

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/)

Repository owner deleted a comment from Kehrlann Feb 13, 2019
Repository owner deleted a comment from Kehrlann Feb 13, 2019
@mfaheemakhtar
Copy link

@mfaheemakhtar mfaheemakhtar commented Apr 3, 2019

@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?

@ilearnio
Copy link
Owner Author

@ilearnio ilearnio commented Apr 3, 2019

@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

@theomjones
Copy link

@theomjones theomjones commented Jun 7, 2019

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

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

@gokberkakdeniz
Copy link

@gokberkakdeniz gokberkakdeniz commented Jul 27, 2019

_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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants