feat: expose webpack.target as rawTarget#943
Conversation
|
I have not updated any documentation nor included any test yet. But I'd like some guidance on how to do both if this change is considered interesting. |
|
I'm not used to working on packages that require being pre-built before they can be used in a project, so if possible could you tell me how can I test this change on my project? I tried adding it to |
| caller: Object.assign( | ||
| { | ||
| name: "babel-loader", | ||
| rawTarget, |
There was a problem hiding this comment.
Maybe I should add this below the target property below?
|
@nicolo-ribaudo do you think this is worth adding? See #826 (comment) for context. I would like to be able to use different browserslist targets and for that I need to pass the raw |
Please Read the CONTRIBUTING Guidelines
In particular the portion on Commit Message Formatting
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
Currently the target exposed via
caller.targetis the normalized target.What is the new behavior?
This change adds a new property called
rawTargetthat exposes the original target as set on the webpack configuration.Does this PR introduce a breaking change?
If this PR contains a breaking change, please describe the following...
Other information:
In the future, I think browserlistEnv option could be automatically set when the webpack's target option is set using
browserslist:${env}. I believe that would make the webpack / babel / browserslist integration easier.I'm afraid that would be a breaking change, and since there are, based on the documentation, future breaking changes it might make sense to wait for that to introduce this automatic
browserlistEnvsetting.