Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Fix usage with raw loader #69

Merged

Conversation

mistic
Copy link
Collaborator

@mistic mistic commented Apr 17, 2019

That should fix #68

/CC @evilebottnawi

@malash
Copy link

malash commented Apr 18, 2019

Could it be better if we use base64 for raw data encoding to reduce the cache file size ?

https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings

@mistic
Copy link
Collaborator Author

mistic commented Apr 19, 2019

@malash thanks for the suggestions. I had them in account on the last changes 👍

@codecov
Copy link

codecov bot commented Apr 19, 2019

Codecov Report

Merging #69 into master will increase coverage by 0.65%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   57.48%   58.13%   +0.65%     
==========================================
  Files           2        2              
  Lines         127      129       +2     
  Branches       20       20              
==========================================
+ Hits           73       75       +2     
  Misses         46       46              
  Partials        8        8
Impacted Files Coverage Δ
src/index.js 58.59% <50%> (+0.65%) ⬆️

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 74037ce...648b93b. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Apr 19, 2019

Codecov Report

Merging #69 into master will increase coverage by 0.65%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   57.48%   58.13%   +0.65%     
==========================================
  Files           2        2              
  Lines         127      129       +2     
  Branches       20       20              
==========================================
+ Hits           73       75       +2     
  Misses         46       46              
  Partials        8        8
Impacted Files Coverage Δ
src/index.js 58.59% <50%> (+0.65%) ⬆️

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 74037ce...648b93b. Read the comment docs.

Copy link

@malash malash left a comment

Choose a reason for hiding this comment

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

LGTM Thanks!

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.

Looks good 👍

Just question: maybe we can use serialize-to-js package, it is support many types and in theory loader can return non buffer and non string (yes it is not used in real life and not good idea, but it it possible)

@alexander-akait alexander-akait merged commit 4924341 into webpack-contrib:master Apr 19, 2019
@mistic
Copy link
Collaborator Author

mistic commented Apr 19, 2019

@evilebottnawi it could have been an excellent solution but after trying that serializer-to-js I found performance penalties. I think we should stick with buffer-json for the time being 😃

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.

Should cache-loader use module.exports.raw = true to handle binary file ?
4 participants