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

file-loader using an 'exclude' pattern is too aggressive #1132

Closed
n0nick opened this issue Dec 19, 2017 · 1 comment
Closed

file-loader using an 'exclude' pattern is too aggressive #1132

n0nick opened this issue Dec 19, 2017 · 1 comment

Comments

@n0nick
Copy link

n0nick commented Dec 19, 2017

The change in package/rule/file.js as part of #1058 made file-loader catch all files not matching some exclude pattern instead of testing against a test pattern.

This means that any file extension not included in the hard-coded exclude pattern is treated by Webpack as a file and tries to generate a dynamic export.

In particular, I was using pug-loader with the following loader config:

{
  test: /\.(pug|jade)?$/,
  use: [
    {
      loader: 'pug-loader'
    }
  ]
};

But since the .jade and .pug file extensions are not part of the hard-coded exclude pattern, Webpack would generate a dynamic export which my app (import template from "file.jade" made template a path string instead of a template function).

@gauravtiwari
Copy link
Member

Duplicate #1127

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