-
-
Notifications
You must be signed in to change notification settings - Fork 158
inconsistent export syntax when used with file-loader@1.0 #85
Comments
@cainlevy can your provide test repo, what is broken? |
Maybe related to webpack-contrib/file-loader#185 |
I tested webpack-contrib/file-loader#183 and confirmed that it does not solve the bug. The problem is that https://github.com/webpack-contrib/url-loader/blob/master/index.js#L31 returns CommonJS exports while https://github.com/webpack-contrib/url-loader/blob/master/index.js#L36 returns ES exports. This inconsistency means that I must switch import syntax depending on whether the image will be inlined or not. Possible solutions:
I can create a test repo if necessary, I'm just hoping to save the work if this issue can be described simply. |
@cainlevy be greate if your create test repo, thanks! |
Test repo: https://github.com/cainlevy/webpack-contrib-url-loader-issue-85 When the source files use ES2015 import syntax, Webpack is able to obscure the difference between But when Webpack bundles with a loader that transpiles to CommonJS (from |
@cainlevy let's fix this after webpack-contrib/file-loader#183 |
We should pin the file-loader dependency to @cainlevy Downgrade |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When used in a project with
file-loader@1.0
, the current version ofurl-loader
will create a CommonJS export for inlined images but an ES module export for external images.If the current behavior is a bug, please provide the steps to reproduce.
file-loader@1.0.0
andurl-loader@0.5.9
url-loader
's configuredlimit
What is the expected behavior?
Consistent export syntax.
The text was updated successfully, but these errors were encountered: