-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
IDE integration #222
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
Comments
Hey @use-strict. It's been a while, but I see you've started working on a |
My original post is still relevant. If you have a look at the webpack-runner tool, inside error-formatter file you will see I did lots of hacky reverse engineering on the webpack errors. I used properties that were available, yet undocumented. While this works, it may break at any time when updating webpack. To summarize:
If this makes sense, we can split this issue into three separate issues. I don't know why I did everything in a single commit, that was a mistake on my part. |
Generally, I'd like to only provide the hooks necessary for you, so your tool can do the job / formatting. |
I'm using the webpack node API. That's the primary concern. dev-server is just a bonus, but I'm thinking a fix for one should also fix the other.
That plugin could work. I didn't know of its existence. I will test it out.
I couldn't find a way to hook into the dev-server from CLI. Much of the options logic is in the CLI entry js file so requiring something directly from dev-server would mean duplicating logic. |
The
Ah, I thought you would be starting the dev-server only from the Node API. From the CLI you can still use the var webpackRunner = require('webpack-runner');
module.exports = {
...
devServer: {
setup: webpackRunner
}
} |
I mean webpack, not webpack-dev-server node API:
Can this reporter option be specified via webpack.config ?
Thanks, I will try and see if it works. |
At the moment, no. But isn't that outside the scope of your package? It's meant for development, right? If you want that functionality you'd need to make a PR in the webpack repo. |
Will do that. As far as the dev-server goes, I will check if that reporter functionality works for me. Thanks for the tips. My webpack-runner module is only filling in for the missing reporter functionality in webpack. It's not necessarily for development and it's not using the dev-server. For dev-server integration I had a separate CLI tool that connected to that HTTP route I showed you and redirected output to the console. I didn't publish it because it only worked with a hacked dev-server. If the error hooks work, I will try to adapt it. |
Ah okay, missed that. I'm going to close this now since there are no specific issues here. If you need specific hooks, feel free to create an issue for them. |
My goal is to have seamless integration with insert_favorite_IDE_here while developing. This means having the compilation errors exposed and mapped to file/line/col in the IDE. I have achieved this to some degree, at the cost of having to hack the dev server, which is less than ideal to say the least.
I will explain what I tried and hope you can help me find a solution that would fit with the existing use cases, so I can get rid of this hack.
First attempt:
This worked like a charm with VSCode, without having to hack webpack or webpack-dev-server in any way. However, this means I cannot benefit from the dev-server features. Also, this doesn't work with PHPStorm/WebStorm, because its file watchers are supposed to execute on every save and it can't keep a single instance running in the background.
Second attempt:
Problems:
I'm linking the commit which contains the changes that I made to the dev-server. This doesn't include the actual formatting of the errors or the client script.
use-strict@3f58f60
I found no clean way of exporting/serializing the errors (which are also circular objects) other than nitpicking each bit of information.
What are your thoughts on this?
The text was updated successfully, but these errors were encountered: