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

webpack 5 resourceQuery #10552

Closed
vankop opened this issue Mar 13, 2020 · 3 comments
Closed

webpack 5 resourceQuery #10552

vankop opened this issue Mar 13, 2020 · 3 comments

Comments

@vankop
Copy link
Member

vankop commented Mar 13, 2020

Bug report

What is the current behavior?

Can not define resourceQuery other than string | Regexp (function also works maybe)

UPD: Don't work only include and exclude

If the current behavior is a bug, please provide the steps to reproduce.

https://github.com/vankop/webpack5-resource-query-bug

What is the expected behavior?

Either compilation should pass, either change Public API (WebpackOptions.d.ts shows that this is possible)

using oneOf all works fine =)

Other relevant information:
webpack version: 5.0.0-beta.14
Node.js version: 10
Operating System: OS X
Additional tools:

@sokra
Copy link
Member

sokra commented Mar 13, 2020

hmm... yes, I remove that for webpack 5. The schema need to be updated to reflect that.

Only not and or are available as conditions.

You can use resourceQuery: {not: /\?another/i},. These condition can be nested so every logic should be available.

For include and exclude it was a bit unclear if multiple items are combined via and or via or. And they are redundant.

@vankop
Copy link
Member Author

vankop commented Mar 13, 2020

but for resource it still works https://github.com/webpack/webpack/blob/master/lib/NormalModuleFactory.js#L113

For include and exclude it was a bit unclear

So it still looks a bit unclear =)

@sokra
Copy link
Member

sokra commented Mar 15, 2020

but for resource it still works https://github.com/webpack/webpack/blob/master/lib/NormalModuleFactory.js#L113

resource: { include: "..." } should not work.
What works is include: "..." as alias for resource.

vankop added a commit to vankop/webpack that referenced this issue Mar 15, 2020
vankop added a commit to vankop/webpack that referenced this issue Mar 15, 2020
sokra added a commit that referenced this issue Mar 18, 2020
fix(#10552) remove test/include/exclude from rule set conditions
@vankop vankop closed this as completed Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants