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

[6.x] Webpack: Support configs written in non-JavaScript #697

Closed
3 tasks done
G-Rath opened this issue Feb 14, 2019 · 4 comments
Closed
3 tasks done

[6.x] Webpack: Support configs written in non-JavaScript #697

G-Rath opened this issue Feb 14, 2019 · 4 comments
Assignees
Labels
enhancement hacktoberfest Good first issue to work on - particularly for Hacktoberfest help wanted plugin/webpack Issues or pull requests related to first-party webpack plugins/templates

Comments

@G-Rath
Copy link

G-Rath commented Feb 14, 2019

  • I have read the contribution documentation for this project.
  • 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.

@malept
Copy link
Member

malept commented Feb 15, 2019

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?

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

@malept malept changed the title Webpack: Support multilingual webpack configs (webpack.config.ts) Webpack: Support webpack configs written in non-JavaScript Feb 15, 2019
@G-Rath
Copy link
Author

G-Rath commented 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 😂

@malept malept changed the title Webpack: Support webpack configs written in non-JavaScript Webpack: Support configs written in non-JavaScript Feb 15, 2019
@malept malept changed the title Webpack: Support configs written in non-JavaScript [6.x] Webpack: Support configs written in non-JavaScript Feb 21, 2019
@thomassuckow
Copy link

#905 suggests adding support for returning a function, then at least you could run the parser yourself and return the json.

@malept malept added the plugin/webpack Issues or pull requests related to first-party webpack plugins/templates label Jan 23, 2020
@malept malept added the hacktoberfest Good first issue to work on - particularly for Hacktoberfest label Sep 30, 2020
midouest added a commit to midouest/runes that referenced this issue Feb 9, 2022
electron forge does not support typescript webpack configurations
even though webpack does. we compile the typescript configurations
to javascript as a workaround.

see electronforge discussion here: electron/forge#697
@issacgerges issacgerges self-assigned this Mar 1, 2022
@erickzhao
Copy link
Member

closed in #3012

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
When bisecting from the command line, it's possible that the last known
good version is an unsupported release. Thus, it's necessary to be able
to re-enable unsupported releases from the command line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement hacktoberfest Good first issue to work on - particularly for Hacktoberfest help wanted plugin/webpack Issues or pull requests related to first-party webpack plugins/templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants