sunflowerdeath / webfonts-generator

Generator of webfonts from svg icons
The Unlicense
271 stars 152 forks source link

result's file contents are all mixed #4

Closed IngwiePhoenix closed 9 years ago

IngwiePhoenix commented 9 years ago

I am almost done with my WebPack loader for generating webfonts using this module. However, when running my test, it turned out that, for some reason, the file contents got totally swapped and mixed up. Here is the "generated" config within the only source file of the module.

https://github.com/IngwiePhoenix/fontgen-loader/blob/master/index.js#L32-L43

And here is what happens:

Ingwie@Ingwies-MBP ~/W/f/test $ webpack
Hash: 640abcea2ea033f3c1d0
Version: webpack 1.8.9
Time: 1002ms
                                         Asset     Size  Chunks             Chunk Names
 bf3348128669f5ef4f8405d22bf5a708-Octicons.eot   111 kB          [emitted]  
539e81463b37bb921e1861d5a8d2f66e-Octicons.woff  30.4 kB          [emitted]  
 ecd0bb310102b5d86e0379dda2e3a77b-Octicons.ttf  30.6 kB          [emitted]  
 0408f44d9d4f8b4ff1a3a6edd5214653-Octicons.svg  17.1 kB          [emitted]  
                                     bundle.js  21.8 kB       0  [emitted]  main
   [0] ./entry.js 59 bytes {0} [built]
    + 4 hidden modules
Ingwie@Ingwies-MBP ~/W/f/test $ file build/*
build/0408f44d9d4f8b4ff1a3a6edd5214653-Octicons.svg:  data
build/539e81463b37bb921e1861d5a8d2f66e-Octicons.woff: TrueType font data
build/bf3348128669f5ef4f8405d22bf5a708-Octicons.eot:  SVG Scalable Vector Graphics image
build/bundle.js:                                      HTML document text
build/ecd0bb310102b5d86e0379dda2e3a77b-Octicons.ttf:  data

I checked, bundle.js has the expected output. But the various font files, don't... Is there anything I am doing wrong in my code?

sunflowerdeath commented 9 years ago

Wow, such mistake. Code was working correctly only when order of types was same as order of fonts generation. I fixed it now.

IngwiePhoenix commented 9 years ago

Seems fixed! :)

Ingwie@Ingwies-Macbook-Pro.local ~/W/f/test $ file build/*
build/2ddfc222221e40b522d3e4a87c58d6df-Octicons.ttf:  TrueType font data
build/64218b3f12ced3b1c40984219fe97238-Octicons.eot:  data
build/bf3348128669f5ef4f8405d22bf5a708-Octicons.svg:  SVG Scalable Vector Graphics image
build/bundle.js:                                      HTML document text
build/e74409b14842bdc432aae1eabcbf861f-Octicons.woff: data