Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

feat: pass immutable info on files #383

Merged
merged 1 commit into from Aug 31, 2020
Merged

feat: pass immutable info on files #383

merged 1 commit into from Aug 31, 2020

Conversation

bschlenk
Copy link
Contributor

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Passes an immutable flag through assetInfo which other plugins may use.

#382

Breaking Changes

Additional Info

@jsf-clabot
Copy link

jsf-clabot commented Aug 26, 2020

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #383 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #383   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           29        30    +1     
  Branches        12        12           
=========================================
+ Hits            29        30    +1     
Impacted Files Coverage Δ
src/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 718aef5...0df7818. Read the comment docs.

@@ -14,16 +14,14 @@ export default function loader(content) {
});

const context = options.context || this.rootContext;
const name = options.name || '[contenthash].[ext]';
const immutable = /\[([^:\]]+:)?(hash|contenthash)(:[^\]]+)?\]/gi.test(name);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this would be another function in https://github.com/webpack/loader-utils

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will test it deeply in near future

@bschlenk
Copy link
Contributor Author

not sure why ModuleConcatenationPlugin test is failing. Source doesn't use the immutable flag, is it unrelated?

@alexander-akait
Copy link
Member

I think we should improve test, webpack@5 implements better tree so count of modules can be reduced

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@alexander-akait
Copy link
Member

I will merge and fix tests after merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants