You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[6.x] Webpack: Support configs written in non-JavaScript #697
I agree to follow the code of conduct that this project follows, as appropriate.
I have searched the issue tracker for an issue that matches the one I want to file, without success.
Please describe your issue:
Webpack supports using config files written in other languages (such as typescript & coffeescript) without the need to compile those files into JS, provided the right tools are installed.
For example, doing webpack will work with webpack.config.ts provided ts-node is installed.
These details are documented (here)[https://webpack.js.org/configuration/configuration-languages/].
It would be great if @eletron-forge/webpack supported this.
Currently, if I have a .ts webpack config, it doesn't get run though ts-node.
An acceptable compromise for me at this point would be to have some of pre-use hook that I could trigger compiling from; for example, being able to pass an npm command like npm run build-configs to compile my configs before they're used.
Reacted by zhyuri, Соснин Алексей, Will Frew and Machisté N. Quintana
I think right now the workaround is to write a shim script that calls ts-node programmatically with your config file.
I think this is a good feature for someone to contribute to Forge. It looks like based off of your link, webpack uses node-interpret to determine how to execute the config file?
changed the title [-]Webpack: Support multilingual webpack configs (webpack.config.ts)[/-][+]Webpack: Support webpack configs written in non-JavaScript[/+]on Feb 15, 2019
I think right now the workaround is to write a shim script that calls ts-node programmatically with your config file.
Yes, something like that - The thing I'd wanted to avoid is having to do npm run build-configs && electron-forge x everywhere.
I think this is a good feature for someone to contribute to Forge.
I was meaning to stick at the end that I'd be interested in having a whack at it if I manage to find some free time, if it sounded like something that could be viable & someone pointed me in the right direction :)
Thanks for the better title - I'm got a bit going on right now, that's got me frazzled so sorry if some of my sentences don't make a lot of sense 😂
changed the title [-]Webpack: Support webpack configs written in non-JavaScript[/-][+]Webpack: Support configs written in non-JavaScript[/+]on Feb 15, 2019
changed the title [-]Webpack: Support configs written in non-JavaScript[/-][+][6.x] Webpack: Support configs written in non-JavaScript[/+]on Feb 21, 2019
Activity
malept commentedon Feb 15, 2019
I think right now the workaround is to write a shim script that calls
ts-nodeprogrammatically with your config file.I think this is a good feature for someone to contribute to Forge. It looks like based off of your link, webpack uses
node-interpretto determine how to execute the config file?I believe this sort of logic would go here:
https://github.com/electron-userland/electron-forge/blob/788412e38cfb7a0efa7202a39d45e47c78b4118b/packages/plugin/webpack/src/WebpackPlugin.ts#L41-L44
[-]Webpack: Support multilingual webpack configs (webpack.config.ts)[/-][+]Webpack: Support webpack configs written in non-JavaScript[/+]G-Rath commentedon Feb 15, 2019
Yes, something like that - The thing I'd wanted to avoid is having to do
npm run build-configs && electron-forge xeverywhere.I was meaning to stick at the end that I'd be interested in having a whack at it if I manage to find some free time, if it sounded like something that could be viable & someone pointed me in the right direction :)
Thanks for the better title - I'm got a bit going on right now, that's got me frazzled so sorry if some of my sentences don't make a lot of sense 😂
[-]Webpack: Support webpack configs written in non-JavaScript[/-][+]Webpack: Support configs written in non-JavaScript[/+][-]Webpack: Support configs written in non-JavaScript[/-][+][6.x] Webpack: Support configs written in non-JavaScript[/+]thomassuckow commentedon Jun 24, 2019
#905 suggests adding support for returning a function, then at least you could run the parser yourself and return the json.
convert webpack configuration to typescript
erickzhao commentedon Oct 31, 2022
closed in #3012
feat: allow obsolete versions to be toggled in cli (#697)