-
Notifications
You must be signed in to change notification settings - Fork 33
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
Please update file-loader
to latest version
#363
Comments
Does esModules=true work for file-loader for webpack version 4?
…On Tue, Feb 4, 2020, 8:44 PM Evilebot Tnawi ***@***.***> wrote:
Latest version of file-loader is
https://github.com/webpack-contrib/file-loader/blob/master/package.json#L3.
We switch to ES modules syntax and it is allow to tree shake code, I would
suggest to do it too:
- update file-loader to latest version, introduce esModule option
(default value is false) and do minor release
- switch esModule to true and do major release
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#363?email_source=notifications&email_token=ABY26CR56SZ6I4UDJUCBRJTRBGLOXA5CNFSM4KP2GSMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IK6RBFA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABY26CSO2ENJXFRPDKUSTELRBGLOXANCNFSM4KP2GSMA>
.
|
@bhovhannes yes, but i recommend to use the |
Temporary solution was to bump file-loader version to v5, passing That was done in #346 . I am not ready to enable @evilebottnawi, just out of curiosity, do you have any evidence showing that writing code with |
You don't need babel for
Yes, it is reduce bundle size - https://webpack.js.org/plugins/module-concatenation-plugin/. It is allow remove unnecessary module and include value of module directly. Less modules - less size- fast runtime |
Thanks for info. |
I mean it was introduced to be false by default and then was made to be true. What was the reason for that? |
Module concatenation, simple example string.js export default "text"; index.js import text from './string.js';
console.log(text); When you run webpack in production mode and got only one module: index.js var text_module_concatenation_variable = 'text';
console.log(text); No extra module. It is very very very simple case. |
Thanks for example. I am trying to understand why you suggest to release 2 versions and introduce a new option - Well yes, if I care about folks using webpack 3 I should probably do like that and have that option in place. |
Some other loaders can't support ES module import so it should be setup from configuration |
Which loaders? Can't we try to upgrade them as well? |
@bhovhannes Any, any developer can create an own loader, so we can't update them, just introduce new option and do it true by default in next major release |
I understand, just wondering if there are popular loaders which still does
not support esModule stuff.
…On Fri, Feb 7, 2020, 8:57 PM Evilebot Tnawi ***@***.***> wrote:
@bhovhannes <https://github.com/bhovhannes> Any, any developer can create
an own loader, so we can't update them, just introduce new option and do it
true by default in next major release
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#363?email_source=notifications&email_token=ABY26CTTUKQJ2E2XDEWV6LTRBWHHPA5CNFSM4KP2GSMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELDX4AI#issuecomment-583499265>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABY26CUTOYHUTXUTIVYPDZDRBWHHPANCNFSM4KP2GSMA>
.
|
All popular loaders inside webpack-contrib and they support esModule 👍 |
BREAKING CHANGE: this changes loader behavior when it falls back to file-loader. New behavior allows better tree-shaking.
Latest version of
file-loader
is https://github.com/webpack-contrib/file-loader/blob/master/package.json#L3. We switch to ES modules syntax and it is allow to tree shake code, I would suggest to do it too:file-loader
to latest version, introduceesModule
option (default value isfalse
) and do minor releaseesModule
totrue
and do major releaseThe text was updated successfully, but these errors were encountered: