From 8a4832d6bf1414bf9f9c0d1f3151b7a025999672 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Sun, 5 Apr 2020 12:11:05 +0200 Subject: [PATCH 01/15] feat: add encoding option --- README.md | 29 ++++++ src/index.js | 10 +- src/options.json | 4 + .../encoding-option.test.js.snap | 98 +++++++++++++++++++ test/encoding-option.test.js | 71 ++++++++++++++ 5 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 test/__snapshots__/encoding-option.test.js.snap create mode 100644 test/encoding-option.test.js diff --git a/README.md b/README.md index ea1dd4e..90125ff 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,35 @@ module.exports = { }; ``` +### `encoding` + +Type: `String` +Default: `base64` + +Specify the encoding which the file will be in-lined with. It supports (Node.js Buffer Encodings)[https://www.w3resource.com/node.js/nodejs-buffer.php] If the encoding is not supported the default `base64` encoding will be used. + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.svg$/i, + use: [ + { + loader: 'url-loader', + options: { + mimetype: 'utf8', + }, + }, + ], + }, + ], + }, +}; +``` + ### `esModule` Type: `Boolean` diff --git a/src/index.js b/src/index.js index faf9202..ac7b352 100644 --- a/src/index.js +++ b/src/index.js @@ -45,10 +45,18 @@ export default function loader(src) { const esModule = typeof options.esModule !== 'undefined' ? options.esModule : true; + let encodedData; + try { + encodedData = src.toString(options.encoding || 'base64'); + } catch (e) { + options.encoding = 'base64'; + encodedData = src.toString(options.encoding); + } + return `${ esModule ? 'export default' : 'module.exports =' } ${JSON.stringify( - `data:${mimetype || ''};base64,${src.toString('base64')}` + `data:${mimetype || ''};${options.encoding || 'base64'},${encodedData}` )}`; } diff --git a/src/options.json b/src/options.json index ee92ab0..433a273 100644 --- a/src/options.json +++ b/src/options.json @@ -5,6 +5,10 @@ "description": "Enables/Disables transformation target file into base64 URIs (https://github.com/webpack-contrib/url-loader#limit).", "type": ["boolean", "number", "string"] }, + "encoding": { + "description": "Specify the encoding which the file will be in-lined with.", + "type": "string" + }, "mimetype": { "description": "The MIME type for the file to be transformed (https://github.com/webpack-contrib/url-loader#mimetype).", "type": "string" diff --git a/test/__snapshots__/encoding-option.test.js.snap b/test/__snapshots__/encoding-option.test.js.snap new file mode 100644 index 0000000..03bb747 --- /dev/null +++ b/test/__snapshots__/encoding-option.test.js.snap @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`"encoding" option should work with "String" right encoding value (hex): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" right encoding value (hex): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (hex): result 1`] = `"data:image/svg+xml;hex,3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0a3c7376672077696474683d223735707822206865696768743d2237357078222076696577426f783d22302030203735203735222076657273696f6e3d22312e312220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f7376672220786d6c6e733a786c696e6b3d22687474703a2f2f7777772e77332e6f72672f313939392f786c696e6b223e0a202020203c212d2d2047656e657261746f723a20536b6574636820332e372e312028323832313529202d20687474703a2f2f7777772e626f68656d69616e636f64696e672e636f6d2f736b65746368202d2d3e0a202020203c7469746c653e6d6f6368693c2f7469746c653e0a202020203c646573633e43726561746564207769746820536b657463682e3c2f646573633e0a202020203c646566733e0a20202020202020203c726563742069643d22706174682d312220783d22302220793d2230222077696474683d22373022206865696768743d223730222072783d2233223e3c2f726563743e0a20202020202020203c6d61736b2069643d226d61736b2d3222206d61736b436f6e74656e74556e6974733d227573657253706163654f6e55736522206d61736b556e6974733d226f626a656374426f756e64696e67426f782220783d22302220793d2230222077696474683d22373022206865696768743d223730222066696c6c3d227768697465223e0a2020202020202020202020203c75736520786c696e6b3a687265663d2223706174682d31223e3c2f7573653e0a20202020202020203c2f6d61736b3e0a202020203c2f646566733e0a202020203c672069643d22506167652d3122207374726f6b653d226e6f6e6522207374726f6b652d77696474683d2231222066696c6c3d226e6f6e65222066696c6c2d72756c653d226576656e6f6464223e0a20202020202020203c672069643d226d6f636869223e0a2020202020202020202020203c672069643d2247726f75702d313522207472616e73666f726d3d227472616e736c61746528312e3030303030302c20312e30303030303029223e0a202020202020202020202020202020203c726563742069643d2252656374616e676c652d36382d436f70792d37222066696c6c3d222334313431343122206f7061636974793d22302e3134393035353530342220783d22332220793d2233222077696474683d22373022206865696768743d223730222072783d2233223e3c2f726563743e0a202020202020202020202020202020203c7573652069643d2252656374616e676c652d363822207374726f6b653d222336333633363322206d61736b3d2275726c28236d61736b2d322922207374726f6b652d77696474683d223522207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d22234646464646462220786c696e6b3a687265663d2223706174682d31223e3c2f7573653e0a202020202020202020202020202020203c672069643d2247726f75702d3922207472616e73666f726d3d227472616e736c61746528372e3030303030302c20382e30303030303029223e0a20202020202020202020202020202020202020203c7061746820643d224d31322e373038373935352c322e3736313636373836204c34312e373038373935352c322e3736313636373836204c31322e373038373935352c322e3736313636373836205a222069643d22506174682d343122207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e6422207472616e73666f726d3d227472616e736c6174652832372e3230383739352c20322e37363136363829207363616c65282d312c203129207472616e736c617465282d32372e3230383739352c202d322e3736313636382920223e3c2f706174683e0a20202020202020202020202020202020202020203c672069643d2247726f75702d37223e0a2020202020202020202020202020202020202020202020203c7061746820643d224d33312e333335393134322c35352e35363239323538204334342e393732333537342c35352e353632393235382035362e303236383738392c34342e353038343034342035362e303236383738392c33302e38373139363131204335362e303236383738392c31372e323335353137382034342e393732333537342c362e31383039393634322033312e333335393134322c362e3138303939363432204331372e363939343730392c362e313830393936343220362e363434393439352c31372e3233353531373820362e363434393439352c33302e383731393631312043362e363434393439352c34342e353038343034342031372e363939343730392c35352e353632393235382033312e333335393134322c35352e35363239323538205a222069643d224f76616c2d33312d436f70792d35222066696c6c3d222334313431343122206f7061636974793d22302e313439303535353034223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d32382e333335393134322c35322e35363239323538204334312e393732333537342c35322e353632393235382035332e303236383738392c34312e353038343034342035332e303236383738392c32372e38373139363131204335332e303236383738392c31342e323335353137382034312e393732333537342c332e31383039393634322032382e333335393134322c332e3138303939363432204331342e363939343730392c332e313830393936343220332e363434393439352c31342e3233353531373820332e363434393439352c32372e383731393631312043332e363434393439352c34312e353038343034342031342e363939343730392c35322e353632393235382032382e333335393134322c35322e35363239323538205a222069643d224f76616c2d333122207374726f6b653d222336333633363322207374726f6b652d77696474683d22322e35222066696c6c3d2223464646464646223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d32332e303739343932352c372e3034373538393937204331362e373037313232352c382e37343439313537392031312e363435343532352c31322e39373034303220382e39383938313233382c31382e34393939323139222069643d22506174682d323122207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c656c6c697073652069643d224f76616c2d3332222066696c6c3d2223463341354135222063783d2234302e38323131313834222063793d2232382e36363235303231222072783d22332e3537353539393538222072793d22322e3331323236363232223e3c2f656c6c697073653e0a2020202020202020202020202020202020202020202020203c656c6c697073652069643d224f76616c2d3332222066696c6c3d2223463341354135222063783d2231372e35333134303232222063793d2232382e34393430323938222072783d22332e3537353539393538222072793d22322e3331323236363232223e3c2f656c6c697073653e0a2020202020202020202020202020202020202020202020203c7061746820643d224d33392e333730363537322c3237204c36382e333730363537322c3237204c33392e333730363537322c3237205a222069643d22506174682d343122207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e6422207472616e73666f726d3d227472616e736c6174652835332e3837303635372c2032372e3030303030302920726f74617465282d3237302e30303030303029207472616e736c617465282d35332e3837303635372c202d32372e3030303030302920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d35322e343136313131372c32362e383832383331204335332e313433333834342c32362e313535353538332035342e353937393239392c32362e313535353538332035352e333235323032362c32362e383832383331204335362e303532343735332c32372e363130313033372035362e303532343735332c32392e303634363439322035352e333235323032362c32392e37393139323139204335342e353937393239392c33302e353139313934362035332e313433333834342c33302e353139313934362035322e343136313131372c32392e37393139323139204335312e3638383833392c32392e303634363439322035312e3638383833392c32372e363130313033372035322e343136313131372c32362e383832383331205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652835332e3837303635372c2032382e3333373337362920726f74617465282d3237302e30303030303029207472616e736c617465282d35332e3837303635372c202d32382e3333373337362920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d35322e343136313131372c31312e383832383331204335332e313433333834342c31312e313535353538332035342e353937393239392c31312e313535353538332035352e333235323032362c31312e383832383331204335362e303532343735332c31322e363130313033372035362e303532343735332c31342e303634363439322035352e333235323032362c31342e37393139323139204335342e353937393239392c31352e353139313934362035332e313433333834342c31352e353139313934362035322e343136313131372c31342e37393139323139204335312e3638383833392c31342e303634363439322035312e3638383833392c31322e363130313033372035322e343136313131372c31312e383832383331205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652835332e3837303635372c2031332e3333373337362920726f74617465282d3237302e30303030303029207472616e736c617465282d35332e3837303635372c202d31332e3333373337362920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d35322e343136313131372c34312e383832383331204335332e313433333834342c34312e313535353538332035342e353937393239392c34312e313535353538332035352e333235323032362c34312e383832383331204335362e303532343735332c34322e363130313033372035362e303532343735332c34342e303634363439322035352e333235323032362c34342e37393139323139204335342e353937393239392c34352e353139313934362035332e313433333834342c34352e353139313934362035322e343136313131372c34342e37393139323139204335312e3638383833392c34342e303634363439322035312e3638383833392c34322e363130313033372035322e343136313131372c34312e383832383331205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652835332e3837303635372c2034332e3333373337362920726f74617465282d3237302e30303030303029207472616e736c617465282d35332e3837303635372c202d34332e3333373337362920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d2d31312e363239333432382c3237204c31372e333730363537322c3237204c2d31312e363239333432382c3237205a222069643d22506174682d343122207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e6422207472616e73666f726d3d227472616e736c61746528322e3837303635372c2032372e3030303030302920726f74617465282d3237302e30303030303029207472616e736c617465282d322e3837303635372c202d32372e3030303030302920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d312e343136313131372c32362e3838323833312043322e31343333383434322c32362e3135353535383320332e35393739323938382c32362e3135353535383320342e33323532303236312c32362e3838323833312043352e30353234373533332c32372e3631303130333720352e30353234373533332c32392e3036343634393220342e33323532303236312c32392e373931393231392043332e35393739323938382c33302e3531393139343620322e31343333383434322c33302e3531393139343620312e343136313131372c32392e373931393231392043302e3638383833383936392c32392e3036343634393220302e3638383833383936392c32372e3631303130333720312e343136313131372c32362e383832383331205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c61746528322e3837303635372c2032382e3333373337362920726f74617465282d3237302e30303030303029207472616e736c617465282d322e3837303635372c202d32382e3333373337362920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d312e343136313131372c31312e3838323833312043322e31343333383434322c31312e3135353535383320332e35393739323938382c31312e3135353535383320342e33323532303236312c31312e3838323833312043352e30353234373533332c31322e3631303130333720352e30353234373533332c31342e3036343634393220342e33323532303236312c31342e373931393231392043332e35393739323938382c31352e3531393139343620322e31343333383434322c31352e3531393139343620312e343136313131372c31342e373931393231392043302e3638383833383936392c31342e3036343634393220302e3638383833383936392c31322e3631303130333720312e343136313131372c31312e383832383331205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c61746528322e3837303635372c2031332e3333373337362920726f74617465282d3237302e30303030303029207472616e736c617465282d322e3837303635372c202d31332e3333373337362920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d312e343136313131372c34312e3838323833312043322e31343333383434322c34312e3135353535383320332e35393739323938382c34312e3135353535383320342e33323532303236312c34312e3838323833312043352e30353234373533332c34322e3631303130333720352e30353234373533332c34342e3036343634393220342e33323532303236312c34342e373931393231392043332e35393739323938382c34352e3531393139343620322e31343333383434322c34352e3531393139343620312e343136313131372c34342e373931393231392043302e3638383833383936392c34342e3036343634393220302e3638383833383936392c34322e3631303130333720312e343136313131372c34312e383832383331205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c61746528322e3837303635372c2034332e3333373337362920726f74617465282d3237302e30303030303029207472616e736c617465282d322e3837303635372c202d34332e3333373337362920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d31322e373038373935352c35322e37363136363739204c34312e373038373935352c35322e37363136363739204c31322e373038373935352c35322e37363136363739205a222069643d22506174682d343122207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e6422207472616e73666f726d3d227472616e736c6174652832372e3230383739352c2035322e37363136363829207363616c65282d312c203129207472616e736c617465282d32372e3230383739352c202d35322e3736313636382920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d32362e3739343633332c35312e33303731323234204332372e353231393035372c35302e353739383439372032382e393736343531312c35302e353739383439372032392e373033373233392c35312e33303731323234204333302e343330393936362c35322e303334333935312033302e343330393936362c35332e343838393430362032392e373033373233392c35342e32313632313333204332382e393736343531312c35342e3934333438362032372e353231393035372c35342e3934333438362032362e3739343633332c35342e32313632313333204332362e303637333630322c35332e343838393430362032362e303637333630322c35322e303334333935312032362e3739343633332c35312e33303731323234205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652832382e3234393137382c2035322e37363136363829207363616c65282d312c203129207472616e736c617465282d32382e3234393137382c202d35322e3736313636382920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d34312e37393637352c35312e33303731323234204334322e353234303232382c35302e353739383439372034332e393738353638322c35302e353739383439372034342e373035383430392c35312e33303731323234204334352e343333313133372c35322e303334333935312034352e343333313133372c35332e343838393430362034342e373035383430392c35342e32313632313333204334332e393738353638322c35342e3934333438362034322e353234303232382c35342e3934333438362034312e37393637352c35342e32313632313333204334312e303639343737332c35332e343838393430362034312e303639343737332c35322e303334333935312034312e37393637352c35312e33303731323234205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652834332e3235313239352c2035322e37363136363829207363616c65282d312c203129207472616e736c617465282d34332e3235313239352c202d35322e3736313636382920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d31302e37393637352c35312e33303731323234204331312e353234303232382c35302e353739383439372031322e393738353638322c35302e353739383439372031332e373035383430392c35312e33303731323234204331342e343333313133372c35322e303334333935312031342e343333313133372c35332e343838393430362031332e373035383430392c35342e32313632313333204331322e393738353638322c35342e3934333438362031312e353234303232382c35342e3934333438362031302e37393637352c35342e32313632313333204331302e303639343737332c35332e343838393430362031302e303639343737332c35322e303334333935312031302e37393637352c35312e33303731323234205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652831322e3235313239352c2035322e37363136363829207363616c65282d312c203129207472616e736c617465282d31322e3235313239352c202d35322e3736313636382920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d32362e3739343633332c312e3330373132323431204332372e353231393035372c302e3537393834393637382032382e393736343531312c302e3537393834393637382032392e373033373233392c312e3330373132323431204333302e343330393936362c322e30333433393531332033302e343330393936362c332e34383839343035392032392e373033373233392c342e3231363231333331204332382e393736343531312c342e39343334383630342032372e353231393035372c342e39343334383630342032362e3739343633332c342e3231363231333331204332362e303637333630322c332e34383839343035392032362e303637333630322c322e30333433393531332032362e3739343633332c312e3330373132323431205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652832382e3234393137382c20322e37363136363829207363616c65282d312c203129207472616e736c617465282d32382e3234393137382c202d322e3736313636382920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d34312e37393637352c312e3330373132323431204334322e353234303232382c302e3537393834393637382034332e393738353638322c302e3537393834393637382034342e373035383430392c312e3330373132323431204334352e343333313133372c322e30333433393531332034352e343333313133372c332e34383839343035392034342e373035383430392c342e3231363231333331204334332e393738353638322c342e39343334383630342034322e353234303232382c342e39343334383630342034312e37393637352c342e3231363231333331204334312e303639343737332c332e34383839343035392034312e303639343737332c322e30333433393531332034312e37393637352c312e3330373132323431205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652834332e3235313239352c20322e37363136363829207363616c65282d312c203129207472616e736c617465282d34332e3235313239352c202d322e3736313636382920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d31302e37393637352c312e3330373132323431204331312e353234303232382c302e3537393834393637382031322e393738353638322c302e3537393834393637382031332e373035383430392c312e3330373132323431204331342e343333313133372c322e30333433393531332031342e343333313133372c332e34383839343035392031332e373035383430392c342e3231363231333331204331322e393738353638322c342e39343334383630342031312e353234303232382c342e39343334383630342031302e37393637352c342e3231363231333331204331302e303639343737332c332e34383839343035392031302e303639343737332c322e30333433393531332031302e37393637352c312e3330373132323431205a222069643d2252656374616e676c652d333022207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64222066696c6c3d222346464646464622207472616e73666f726d3d227472616e736c6174652831322e3235313239352c20322e37363136363829207363616c65282d312c203129207472616e736c617465282d31322e3235313239352c202d322e3736313636382920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d32362e383537333035322c33312e39303332323033204332362e383537333035322c33302e383234343032392032372e3731353336322c32392e373533373532392032392e313634313330322c32392e373533373533204333302e363132383938352c32392e3735333735332033312e343935323135342c33302e383634383736382033312e343935323135342c33312e39383435393134222069643d22506174682d3138352d436f707922207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e6422207472616e73666f726d3d227472616e736c6174652832392e3137363236302c2033302e3836393137322920726f74617465282d3138302e30303030303029207472616e736c617465282d32392e3137363236302c202d33302e3836393137322920223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d31372e373430383634382c32352e30373630303633204331372e373430383634382c32352e303736303036332031372e343739393930372c32312e353336383231392032302e323336343038362c32312e35333638323231204332322e3738303831382c32312e353336383232332032322e373331393532332c32352e303736303036332032322e373331393532332c32352e30373630303633222069643d22506174682d37312d436f70792d3222207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64223e3c2f706174683e0a2020202020202020202020202020202020202020202020203c7061746820643d224d33352e303035343134312c32352e30373630303633204333352e303035343134312c32352e303736303036332033342e37343435342c32312e353336383231392033372e353030393537382c32312e35333638323231204334302e303435333637322c32312e353336383232332033392e393936353031352c32352e303736303036332033392e393936353031352c32352e30373630303633222069643d22506174682d37312d436f707922207374726f6b653d222336333633363322207374726f6b652d6c696e656361703d22726f756e6422207374726f6b652d6c696e656a6f696e3d22726f756e64223e3c2f706174683e0a20202020202020202020202020202020202020203c2f673e0a202020202020202020202020202020203c2f673e0a2020202020202020202020203c2f673e0a20202020202020203c2f673e0a202020203c2f673e0a3c2f7376673e"`; + +exports[`"encoding" option should work with "String" right encoding value (hex): warnings 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (utf8): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" right encoding value (utf8): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (utf8): result 1`] = ` +"data:image/svg+xml;utf8, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"encoding" option should work with "String" right encoding value (utf8): warnings 1`] = `Array []`; + +exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0Y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C4yMzY0MDg2LDIxLjUzNjgyMjEgQzIyLjc4MDgxOCwyMS41MzY4MjIzIDIyLjczMTk1MjMsMjUuMDc2MDA2MyAyMi43MzE5NTIzLDI1LjA3NjAwNjMiIGlkPSJQYXRoLTcxLUNvcHktMiIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTM1LjAwNTQxNDEsMjUuMDc2MDA2MyBDMzUuMDA1NDE0MSwyNS4wNzYwMDYzIDM0Ljc0NDU0LDIxLjUzNjgyMTkgMzcuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; + +exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: warnings 1`] = `Array []`; + +exports[`"encoding" option should work with unspecified value with the default base64 encoding: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with unspecified value with the default base64 encoding: errors 1`] = `Array []`; + +exports[`"encoding" option should work with unspecified value with the default base64 encoding: result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0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uMDc2MDA2MyAyMi43MzE5NTIzLDI1LjA3NjAwNjMiIGlkPSJQYXRoLTcxLUNvcHktMiIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTM1LjAwNTQxNDEsMjUuMDc2MDA2MyBDMzUuMDA1NDE0MSwyNS4wNzYwMDYzIDM0Ljc0NDU0LDIxLjUzNjgyMTkgMzcuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; + +exports[`"encoding" option should work with unspecified value with the default base64 encoding: warnings 1`] = `Array []`; diff --git a/test/encoding-option.test.js b/test/encoding-option.test.js new file mode 100644 index 0000000..8c308b7 --- /dev/null +++ b/test/encoding-option.test.js @@ -0,0 +1,71 @@ +import { + compile, + execute, + getCompiler, + normalizeErrors, + readAsset, +} from './helpers'; + +describe('"encoding" option', () => { + it('should work with unspecified value with the default base64 encoding', async () => { + const compiler = getCompiler('simple-svg.js'); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "String" right encoding value (utf8)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'utf8', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "String" right encoding value (hex)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'hex', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "String" wrong value equal to xyz by falling back to base64 encoding', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'xyz', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); +}); From b577422e162e4a450d0bd180ef8ecfad6910dbd3 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 12:18:43 +0200 Subject: [PATCH 02/15] feat: specify the allowed encodings --- README.md | 2 +- src/index.js | 11 +- src/options.json | 12 +- .../encoding-option.test.js.snap | 215 +++++++++++++++++- test/encoding-option.test.js | 98 +++++++- 5 files changed, 321 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 90125ff..12d4b5a 100644 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ module.exports = { Type: `String` Default: `base64` -Specify the encoding which the file will be in-lined with. It supports (Node.js Buffer Encodings)[https://www.w3resource.com/node.js/nodejs-buffer.php] If the encoding is not supported the default `base64` encoding will be used. +Specify the encoding which the file will be in-lined with. It supports (Node.js Buffers and Character Encodings)[https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings] which are `["utf8","utf16le","latin1","base64","hex","ascii","binary","ucs2"]`. **webpack.config.js** diff --git a/src/index.js b/src/index.js index ac7b352..579ac75 100644 --- a/src/index.js +++ b/src/index.js @@ -36,6 +36,7 @@ export default function loader(src) { if (shouldTransform(options.limit, src.length)) { const file = this.resourcePath; const mimetype = options.mimetype || mime.contentType(path.extname(file)); + const encoding = options.encoding || 'base64'; if (typeof src === 'string') { // eslint-disable-next-line no-param-reassign @@ -45,18 +46,10 @@ export default function loader(src) { const esModule = typeof options.esModule !== 'undefined' ? options.esModule : true; - let encodedData; - try { - encodedData = src.toString(options.encoding || 'base64'); - } catch (e) { - options.encoding = 'base64'; - encodedData = src.toString(options.encoding); - } - return `${ esModule ? 'export default' : 'module.exports =' } ${JSON.stringify( - `data:${mimetype || ''};${options.encoding || 'base64'},${encodedData}` + `data:${mimetype || ''};${encoding},${src.toString(encoding)}` )}`; } diff --git a/src/options.json b/src/options.json index 433a273..f0d1081 100644 --- a/src/options.json +++ b/src/options.json @@ -7,7 +7,17 @@ }, "encoding": { "description": "Specify the encoding which the file will be in-lined with.", - "type": "string" + "type": "string", + "enum": [ + "utf8", + "utf16le", + "latin1", + "base64", + "hex", + "ascii", + "binary", + "ucs2" + ] }, "mimetype": { "description": "The MIME type for the file to be transformed (https://github.com/webpack-contrib/url-loader#mimetype).", diff --git a/test/__snapshots__/encoding-option.test.js.snap b/test/__snapshots__/encoding-option.test.js.snap index 03bb747..560cf8d 100644 --- a/test/__snapshots__/encoding-option.test.js.snap +++ b/test/__snapshots__/encoding-option.test.js.snap @@ -1,5 +1,139 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`"encoding" option should work with "String" right encoding value (ascii): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" right encoding value (ascii): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (ascii): result 1`] = ` +"data:image/svg+xml;ascii, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"encoding" option should work with "String" right encoding value (ascii): warnings 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (base64): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" right encoding value (base64): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (base64): result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjcuMSAoMjgyMTUpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPm1vY2hpPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+CiAgICAgICAgPHJlY3QgaWQ9InBhdGgtMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjcwIiByeD0iMyI+PC9yZWN0PgogICAgICAgIDxtYXNrIGlkPSJtYXNrLTIiIG1hc2tDb250ZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBtYXNr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AgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; + +exports[`"encoding" option should work with "String" right encoding value (base64): warnings 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (binary): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" right encoding value (binary): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (binary): result 1`] = ` +"data:image/svg+xml;binary, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"encoding" option should work with "String" right encoding value (binary): warnings 1`] = `Array []`; + exports[`"encoding" option should work with "String" right encoding value (hex): assets 1`] = ` Array [ "main.bundle.js", @@ -12,6 +146,79 @@ exports[`"encoding" option should work with "String" right encoding value (hex): exports[`"encoding" option should work with "String" right encoding value (hex): warnings 1`] = `Array []`; +exports[`"encoding" option should work with "String" right encoding value (latin1): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" right encoding value (latin1): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (latin1): result 1`] = ` +"data:image/svg+xml;latin1, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"encoding" option should work with "String" right encoding value (latin1): warnings 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (ucs2): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "String" right encoding value (ucs2): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "String" right encoding value (ucs2): result 1`] = `"data:image/svg+xml;ucs2,㼼浸敶獲潩㵮ㄢ〮•湥潣楤杮∽呕ⵆ∸猠慴摮污湯㵥渢≯㸿㰊癳⁧楷瑤㵨㜢瀵≸栠楥桧㵴㜢瀵≸瘠敩䉷硯∽‰‰㔷㜠∵瘠牥楳湯∽⸱∱砠汭獮∽瑨灴⼺眯睷眮⸳牯⽧〲〰猯杶•浸湬㩳汸湩㵫栢瑴㩰⼯睷⹷㍷漮杲ㄯ㤹⼹汸湩≫ਾ††ℼⴭ䜠湥牥瑡牯›歓瑥档㌠㜮ㄮ⠠㠲ㄲ⤵ⴠ栠瑴㩰⼯睷⹷潢敨業湡潣楤杮挮浯猯敫捴⁨ⴭਾ††琼瑩敬派捯楨⼼楴汴㹥 †㰠敤捳䌾敲瑡摥眠瑩⁨歓瑥档㰮搯獥㹣 †㰠敤獦ਾ††††爼捥⁴摩∽慰桴ㄭ•㵸〢•㵹〢•楷瑤㵨㜢∰栠楥桧㵴㜢∰爠㵸㌢㸢⼼敲瑣ਾ††††洼獡摩∽慭歳㈭•慭歳潃瑮湥啴楮獴∽獵牥灓捡佥啮敳•慭歳湕瑩㵳漢橢捥䉴畯摮湩䉧硯•㵸〢•㵹〢•楷瑤㵨㜢∰栠楥桧㵴㜢∰映汩㵬眢楨整㸢 †††††㰠獵⁥汸湩㩫牨晥∽瀣瑡⵨∱㰾甯敳ਾ††††⼼慭歳ਾ††⼼敤獦ਾ††朼椠㵤倢条ⵥ∱猠牴歯㵥渢湯≥猠牴歯ⵥ楷瑤㵨ㄢ•楦汬∽潮敮•楦汬爭汵㵥攢敶潮摤㸢 †††㰠⁧摩∽潭档≩ਾ††††††朼椠㵤䜢潲灵ㄭ∵琠慲獮潦浲∽牴湡汳瑡⡥⸱〰〰〰‬⸱〰〰〰∩ਾ††††††††爼捥⁴摩∽敒瑣湡汧ⵥ㠶䌭灯⵹∷映汩㵬⌢ㄴㄴㄴ•灯捡瑩㵹〢ㄮ㤴㔰㔵㐰•㵸㌢•㵹㌢•楷瑤㵨㜢∰栠楥桧㵴㜢∰爠㵸㌢㸢⼼敲瑣ਾ††††††††甼敳椠㵤刢捥慴杮敬㘭∸猠牴歯㵥⌢㌶㌶㌶•慭歳∽牵⡬洣獡⵫⤲•瑳潲敫眭摩桴∽∵猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆砠楬歮栺敲㵦⌢慰桴ㄭ㸢⼼獵㹥 †††††††㰠⁧摩∽片畯⵰∹琠慲獮潦浲∽牴湡汳瑡⡥⸷〰〰〰‬⸸〰〰〰∩ਾ††††††††††瀼瑡⁨㵤䴢㈱㜮㠰㤷㔵㈬㜮ㄶ㘶㠷‶㑌⸱〷㜸㔹ⰵ⸲㘷㘱㜶㘸䰠㈱㜮㠰㤷㔵㈬㜮ㄶ㘶㠷‶≚椠㵤倢瑡⵨ㄴ•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•牴湡晳牯㵭琢慲獮慬整㈨⸷〲㜸㔹‬⸲㘷㘱㠶
捳污⡥ㄭ‬⤱琠慲獮慬整⴨㜲㈮㠰㤷ⰵⴠ⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††朼椠㵤䜢潲灵㜭㸢 †††††††††††㰠慰桴搠∽㍍⸱㌳㤵㐱ⰲ㔵㔮㈶㈹㠵䌠㐴㤮㈷㔳㐷㔬⸵㘵㤲㔲‸㘵〮㘲㜸㤸㐬⸴〵㐸㐰‴㘵〮㘲㜸㤸㌬⸰㜸㤱ㄶ‱㕃⸶㈰㠶㠷ⰹ㜱㈮㔳ㄵ㠷㐠⸴㜹㌲㜵ⰴ⸶㠱㤰㘹㈴㌠⸱㌳㤵㐱ⰲ⸶㠱㤰㘹㈴䌠㜱㘮㤹㜴㤰㘬ㄮ〸㤹㐶′⸶㐶㤴㤴ⰵ㜱㈮㔳ㄵ㠷㘠㘮㐴㐹㔹㌬⸰㜸㤱ㄶ‱㙃㘮㐴㐹㔹㐬⸴〵㐸㐰‴㜱㘮㤹㜴㤰㔬⸵㘵㤲㔲‸ㄳ㌮㔳ㄹ㈴㔬⸵㘵㤲㔲‸≚椠㵤伢慶⵬ㄳ䌭灯⵹∵映汩㵬⌢ㄴㄴㄴ•灯捡瑩㵹〢ㄮ㤴㔰㔵㐰㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢㠲㌮㔳ㄹ㈴㔬⸲㘵㤲㔲‸㑃⸱㜹㌲㜵ⰴ㈵㔮㈶㈹㠵㔠⸳㈰㠶㠷ⰹㄴ㔮㠰〴㐴㔠⸳㈰㠶㠷ⰹ㜲㠮ㄷ㘹ㄱ䌠㌵〮㘲㜸㤸ㄬ⸴㌲㔵㜱‸ㄴ㤮㈷㔳㐷㌬ㄮ〸㤹㐶′㠲㌮㔳ㄹ㈴㌬ㄮ〸㤹㐶′ㅃ⸴㤶㐹〷ⰹ⸳㠱㤰㘹㈴㌠㘮㐴㐹㔹ㄬ⸴㌲㔵㜱‸⸳㐶㤴㤴ⰵ㜲㠮ㄷ㘹ㄱ䌠⸳㐶㤴㤴ⰵㄴ㔮㠰〴㐴ㄠ⸴㤶㐹〷ⰹ㈵㔮㈶㈹㠵㈠⸸㌳㤵㐱ⰲ㈵㔮㈶㈹㠵娠•摩∽癏污㌭∱猠牴歯㵥⌢㌶㌶㌶•瑳潲敫眭摩桴∽⸲∵映汩㵬⌢䙆䙆䙆㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢㌲〮㤷㤴㔲㜬〮㜴㠵㤹‷ㅃ⸶〷ㄷ㈲ⰵ⸸㐷㤴㔱㤷ㄠ⸱㐶㐵㈵ⰵ㈱㤮〷〴′⸸㠹㠹㈱㠳ㄬ⸸㤴㤹ㄲ∹椠㵤倢瑡⵨ㄲ•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮㸢⼼慰桴ਾ††††††††††††攼汬灩敳椠㵤伢慶⵬㈳•楦汬∽䘣䄳䄵∵挠㵸㐢⸰㈸ㄱ㠱∴挠㵹㈢⸸㘶㔲㈰∱爠㵸㌢㔮㔷㤵㔹∸爠㵹㈢㌮㈱㘲㈶∲㰾支汬灩敳ਾ††††††††††††攼汬灩敳椠㵤伢慶⵬㈳•楦汬∽䘣䄳䄵∵挠㵸ㄢ⸷㌵㐱㈰∲挠㵹㈢⸸㤴〴㤲∸爠㵸㌢㔮㔷㤵㔹∸爠㵹㈢㌮㈱㘲㈶∲㰾支汬灩敳ਾ††††††††††††瀼瑡⁨㵤䴢㤳㌮〷㔶㈷㈬‷㙌⸸㜳㘰㜵ⰲ㜲䰠㤳㌮〷㔶㈷㈬‷≚椠㵤倢瑡⵨ㄴ•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㜲〮〰〰⤰爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㜲〮〰〰⤰∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㕍⸲ㄴㄶㄱⰷ㘲㠮㈸㌸‱㕃⸳㐱㌳㐸ⰴ㘲ㄮ㔵㔵㌸㔠⸴㤵㤷㤲ⰹ㘲ㄮ㔵㔵㌸㔠⸵㈳㈵㈰ⰶ㘲㠮㈸㌸‱㕃⸶㔰㐲㔷ⰳ㜲㘮〱〱㜳㔠⸶㔰㐲㔷ⰳ㤲〮㐶㐶㈹㔠⸵㈳㈵㈰ⰶ㤲㜮ㄹ㈹㤱䌠㐵㔮㜹㈹㤹㌬⸰ㄵㄹ㐹‶㌵ㄮ㌴㠳㐴㌬⸰ㄵㄹ㐹‶㈵㐮㘱ㄱ㜱㈬⸹㤷㤱ㄲ‹㕃⸱㠶㠸㤳㈬⸹㘰㘴㤴′ㄵ㘮㠸㌸ⰹ㜲㘮〱〱㜳㔠⸲ㄴㄶㄱⰷ㘲㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㠲㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㠲㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㕍⸲ㄴㄶㄱⰷㄱ㠮㈸㌸‱㕃⸳㐱㌳㐸ⰴㄱㄮ㔵㔵㌸㔠⸴㤵㤷㤲ⰹㄱㄮ㔵㔵㌸㔠⸵㈳㈵㈰ⰶㄱ㠮㈸㌸‱㕃⸶㔰㐲㔷ⰳ㈱㘮〱〱㜳㔠⸶㔰㐲㔷ⰳ㐱〮㐶㐶㈹㔠⸵㈳㈵㈰ⰶ㐱㜮ㄹ㈹㤱䌠㐵㔮㜹㈹㤹ㄬ⸵ㄵㄹ㐹‶㌵ㄮ㌴㠳㐴ㄬ⸵ㄵㄹ㐹‶㈵㐮㘱ㄱ㜱ㄬ⸴㤷㤱ㄲ‹㕃⸱㠶㠸㤳ㄬ⸴㘰㘴㤴′ㄵ㘮㠸㌸ⰹ㈱㘮〱〱㜳㔠⸲ㄴㄶㄱⰷㄱ㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㌱㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㌱㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㕍⸲ㄴㄶㄱⰷㄴ㠮㈸㌸‱㕃⸳㐱㌳㐸ⰴㄴㄮ㔵㔵㌸㔠⸴㤵㤷㤲ⰹㄴㄮ㔵㔵㌸㔠⸵㈳㈵㈰ⰶㄴ㠮㈸㌸‱㕃⸶㔰㐲㔷ⰳ㈴㘮〱〱㜳㔠⸶㔰㐲㔷ⰳ㐴〮㐶㐶㈹㔠⸵㈳㈵㈰ⰶ㐴㜮ㄹ㈹㤱䌠㐵㔮㜹㈹㤹㐬⸵ㄵㄹ㐹‶㌵ㄮ㌴㠳㐴㐬⸵ㄵㄹ㐹‶㈵㐮㘱ㄱ㜱㐬⸴㤷㤱ㄲ‹㕃⸱㠶㠸㤳㐬⸴㘰㘴㤴′ㄵ㘮㠸㌸ⰹ㈴㘮〱〱㜳㔠⸲ㄴㄶㄱⰷㄴ㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㌴㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㌴㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ⵍㄱ㘮㤲㐳㠲㈬‷ㅌ⸷㜳㘰㜵ⰲ㜲䰠ㄭ⸱㈶㌹㈴ⰸ㜲娠•摩∽慐桴㐭∱猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤琠慲獮潦浲∽牴湡汳瑡⡥⸲㜸㘰㜵‬㜲〮〰〰⤰爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨⸲㜸㘰㜵‬㈭⸷〰〰〰
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢⸱ㄴㄶㄱⰷ㘲㠮㈸㌸‱㉃ㄮ㌴㠳㐴ⰲ㘲ㄮ㔵㔵㌸㌠㔮㜹㈹㠹ⰸ㘲ㄮ㔵㔵㌸㐠㌮㔲〲㘲ⰱ㘲㠮㈸㌸‱㕃〮㈵㜴㌵ⰳ㜲㘮〱〱㜳㔠〮㈵㜴㌵ⰳ㤲〮㐶㐶㈹㐠㌮㔲〲㘲ⰱ㤲㜮ㄹ㈹㤱䌠⸳㤵㤷㤲㠸㌬⸰ㄵㄹ㐹‶⸲㐱㌳㐸㈴㌬⸰ㄵㄹ㐹‶⸱ㄴㄶㄱⰷ㤲㜮ㄹ㈹㤱䌠⸰㠶㠸㠳㘹ⰹ㤲〮㐶㐶㈹〠㘮㠸㌸㤸㤶㈬⸷ㄶ㄰㌰‷⸱ㄴㄶㄱⰷ㘲㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㈨㠮〷㔶ⰷ㈠⸸㌳㌷㘷
潲慴整⴨㜲⸰〰〰〰
牴湡汳瑡⡥㈭㠮〷㔶ⰷⴠ㠲㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ㐮㘱ㄱ㜱ㄬ⸱㠸㠲ㄳ䌠⸲㐱㌳㐸㈴ㄬ⸱㔱㔵㠵″⸳㤵㤷㤲㠸ㄬ⸱㔱㔵㠵″⸴㈳㈵㈰ㄶㄬ⸱㠸㠲ㄳ䌠⸵㔰㐲㔷㌳ㄬ⸲ㄶ㄰㌰‷⸵㔰㐲㔷㌳ㄬ⸴㘰㘴㤴′⸴㈳㈵㈰ㄶㄬ⸴㤷㤱ㄲ‹㍃㔮㜹㈹㠹ⰸ㔱㔮㤱㤱㘴㈠ㄮ㌴㠳㐴ⰲ㔱㔮㤱㤱㘴ㄠ㐮㘱ㄱ㜱ㄬ⸴㤷㤱ㄲ‹ぃ㘮㠸㌸㤸㤶ㄬ⸴㘰㘴㤴′⸰㠶㠸㠳㘹ⰹ㈱㘮〱〱㜳ㄠ㐮㘱ㄱ㜱ㄬ⸱㠸㠲ㄳ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥⸲㜸㘰㜵‬㌱㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨⸲㜸㘰㜵‬ㄭ⸳㌳㌷㘷
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢⸱ㄴㄶㄱⰷㄴ㠮㈸㌸‱㉃ㄮ㌴㠳㐴ⰲㄴㄮ㔵㔵㌸㌠㔮㜹㈹㠹ⰸㄴㄮ㔵㔵㌸㐠㌮㔲〲㘲ⰱㄴ㠮㈸㌸‱㕃〮㈵㜴㌵ⰳ㈴㘮〱〱㜳㔠〮㈵㜴㌵ⰳ㐴〮㐶㐶㈹㐠㌮㔲〲㘲ⰱ㐴㜮ㄹ㈹㤱䌠⸳㤵㤷㤲㠸㐬⸵ㄵㄹ㐹‶⸲㐱㌳㐸㈴㐬⸵ㄵㄹ㐹‶⸱ㄴㄶㄱⰷ㐴㜮ㄹ㈹㤱䌠⸰㠶㠸㠳㘹ⰹ㐴〮㐶㐶㈹〠㘮㠸㌸㤸㤶㐬⸲ㄶ㄰㌰‷⸱ㄴㄶㄱⰷㄴ㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㈨㠮〷㔶ⰷ㐠⸳㌳㌷㘷
潲慴整⴨㜲⸰〰〰〰
牴湡汳瑡⡥㈭㠮〷㔶ⰷⴠ㌴㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ⸲〷㜸㔹ⰵ㈵㜮ㄶ㘶㤷䰠ㄴ㜮㠰㤷㔵㔬⸲㘷㘱㜶‹ㅌ⸲〷㜸㔹ⰵ㈵㜮ㄶ㘶㤷娠•摩∽慐桴㐭∱猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤琠慲獮潦浲∽牴湡汳瑡⡥㜲㈮㠰㤷ⰵ㔠⸲㘷㘱㠶
捳污⡥ㄭ‬⤱琠慲獮慬整⴨㜲㈮㠰㤷ⰵⴠ㈵㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㉍⸶㤷㘴㌳㔬⸱〳ㄷ㈲‴㉃⸷㈵㤱㔰ⰷ〵㔮㤷㐸㜹㈠⸸㜹㐶ㄵⰱ〵㔮㤷㐸㜹㈠⸹〷㜳㌲ⰹㄵ㌮㜰㈱㐲䌠〳㐮〳㤹㘶㔬⸲㌰㌴㔹‱〳㐮〳㤹㘶㔬⸳㠴㤸〴‶㤲㜮㌰㈷㤳㔬⸴ㄲ㈶㌱″㉃⸸㜹㐶ㄵⰱ㐵㤮㌴㠴‶㜲㔮ㄲ〹㜵㔬⸴㐹㐳㘸㈠⸶㤷㘴㌳㔬⸴ㄲ㈶㌱″㉃⸶㘰㌷〶ⰲ㌵㐮㠸㐹㘰㈠⸶㘰㌷〶ⰲ㈵〮㐳㤳ㄵ㈠⸶㤷㘴㌳㔬⸱〳ㄷ㈲‴≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㈨⸸㐲ㄹ㠷‬㈵㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㈭⸸㐲ㄹ㠷‬㔭⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢ㄴ㜮㘹㔷㔬⸱〳ㄷ㈲‴㑃⸲㈵〴㈲ⰸ〵㔮㤷㐸㜹㐠⸳㜹㔸㠶ⰲ〵㔮㤷㐸㜹㐠⸴〷㠵〴ⰹㄵ㌮㜰㈱㐲䌠㔴㐮㌳ㄱ㜳㔬⸲㌰㌴㔹‱㔴㐮㌳ㄱ㜳㔬⸳㠴㤸〴‶㐴㜮㔰㐸㤰㔬⸴ㄲ㈶㌱″㑃⸳㜹㔸㠶ⰲ㐵㤮㌴㠴‶㈴㔮㐲㈰㠲㔬⸴㐹㐳㘸㐠⸱㤷㜶ⰵ㐵㈮㘱ㄲ㌳䌠ㄴ〮㤶㜴㌷㔬⸳㠴㤸〴‶ㄴ〮㤶㜴㌷㔬⸲㌰㌴㔹‱ㄴ㜮㘹㔷㔬⸱〳ㄷ㈲‴≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㐨⸳㔲㈱㔹‬㈵㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㐭⸳㔲㈱㔹‬㔭⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢〱㜮㘹㔷㔬⸱〳ㄷ㈲‴ㅃ⸱㈵〴㈲ⰸ〵㔮㤷㐸㜹ㄠ⸲㜹㔸㠶ⰲ〵㔮㤷㐸㜹ㄠ⸳〷㠵〴ⰹㄵ㌮㜰㈱㐲䌠㐱㐮㌳ㄱ㜳㔬⸲㌰㌴㔹‱㐱㐮㌳ㄱ㜳㔬⸳㠴㤸〴‶㌱㜮㔰㐸㤰㔬⸴ㄲ㈶㌱″ㅃ⸲㜹㔸㠶ⰲ㐵㤮㌴㠴‶ㄱ㔮㐲㈰㠲㔬⸴㐹㐳㘸ㄠ⸰㤷㜶ⰵ㐵㈮㘱ㄲ㌳䌠〱〮㤶㜴㌷㔬⸳㠴㤸〴‶〱〮㤶㜴㌷㔬⸲㌰㌴㔹‱〱㜮㘹㔷㔬⸱〳ㄷ㈲‴≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整ㄨ⸲㔲㈱㔹‬㈵㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥ㄭ⸲㔲㈱㔹‬㔭⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢㘲㜮㐹㌶ⰳ⸱〳ㄷ㈲ㄴ䌠㜲㔮ㄲ〹㜵〬㔮㤷㐸㘹㠷㈠⸸㜹㐶ㄵⰱ⸰㜵㠹㤴㜶‸㤲㜮㌰㈷㤳ㄬ㌮㜰㈱㐲‱㍃⸰㌴㤰㘹ⰶ⸲㌰㌴㔹㌱㌠⸰㌴㤰㘹ⰶ⸳㠴㤸〴㤵㈠⸹〷㜳㌲ⰹ⸴ㄲ㈶㌱ㄳ䌠㠲㤮㘷㔴ㄱ㐬㤮㌴㠴〶‴㜲㔮ㄲ〹㜵㐬㤮㌴㠴〶‴㘲㜮㐹㌶ⰳ⸴ㄲ㈶㌱ㄳ䌠㘲〮㜶㘳㈰㌬㐮㠸㐹㔰‹㘲〮㜶㘳㈰㈬〮㐳㤳ㄵ″㘲㜮㐹㌶ⰳ⸱〳ㄷ㈲ㄴ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥㠲㈮㤴㜱ⰸ㈠㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㈭⸸㐲ㄹ㠷‬㈭㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㑍⸱㤷㜶ⰵ⸱〳ㄷ㈲ㄴ䌠㈴㔮㐲㈰㠲〬㔮㤷㐸㘹㠷㐠⸳㜹㔸㠶ⰲ⸰㜵㠹㤴㜶‸㐴㜮㔰㐸㤰ㄬ㌮㜰㈱㐲‱㑃⸵㌴ㄳ㌱ⰷ⸲㌰㌴㔹㌱㐠⸵㌴ㄳ㌱ⰷ⸳㠴㤸〴㤵㐠⸴〷㠵〴ⰹ⸴ㄲ㈶㌱ㄳ䌠㌴㤮㠷㘵㈸㐬㤮㌴㠴〶‴㈴㔮㐲㈰㠲㐬㤮㌴㠴〶‴ㄴ㜮㘹㔷㐬㈮㘱ㄲ㌳‱㑃⸱㘰㐹㜷ⰳ⸳㠴㤸〴㤵㐠⸱㘰㐹㜷ⰳ⸲㌰㌴㔹㌱㐠⸱㤷㜶ⰵ⸱〳ㄷ㈲ㄴ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥㌴㈮ㄵ㤲ⰵ㈠㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㐭⸳㔲㈱㔹‬㈭㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ⸰㤷㜶ⰵ⸱〳ㄷ㈲ㄴ䌠ㄱ㔮㐲㈰㠲〬㔮㤷㐸㘹㠷ㄠ⸲㜹㔸㠶ⰲ⸰㜵㠹㤴㜶‸㌱㜮㔰㐸㤰ㄬ㌮㜰㈱㐲‱ㅃ⸴㌴ㄳ㌱ⰷ⸲㌰㌴㔹㌱ㄠ⸴㌴ㄳ㌱ⰷ⸳㠴㤸〴㤵ㄠ⸳〷㠵〴ⰹ⸴ㄲ㈶㌱ㄳ䌠㈱㤮㠷㘵㈸㐬㤮㌴㠴〶‴ㄱ㔮㐲㈰㠲㐬㤮㌴㠴〶‴〱㜮㘹㔷㐬㈮㘱ㄲ㌳‱ㅃ⸰㘰㐹㜷ⰳ⸳㠴㤸〴㤵ㄠ⸰㘰㐹㜷ⰳ⸲㌰㌴㔹㌱ㄠ⸰㤷㜶ⰵ⸱〳ㄷ㈲ㄴ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥㈱㈮ㄵ㤲ⰵ㈠㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥ㄭ⸲㔲㈱㔹‬㈭㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㉍⸶㔸㌷㔰ⰲㄳ㤮㌰㈲㌰䌠㘲㠮㜵〳㈵㌬⸰㈸㐴㈰‹㜲㜮㔱㘳ⰲ㤲㜮㌵㔷㤲㈠⸹㘱ㄴ〳ⰲ㤲㜮㌵㔷″㍃⸰ㄶ㠲㠹ⰵ㤲㜮㌵㔷″ㄳ㐮㔹ㄲ㐵㌬⸰㘸㠴㘷‸ㄳ㐮㔹ㄲ㐵㌬⸱㠹㔴ㄹ∴椠㵤倢瑡⵨㠱ⴵ潃祰•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•牴湡晳牯㵭琢慲獮慬整㈨⸹㜱㈶〶‬〳㠮㤶㜱⤲爠瑯瑡⡥ㄭ〸〮〰〰⤰琠慲獮慬整⴨㤲ㄮ㘷㘲ⰰⴠ〳㠮㤶㜱⤲∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ⸷㐷㠰㐶ⰸ㔲〮㘷〰㌶䌠㜱㜮〴㘸㠴㈬⸵㜰〶㘰″㜱㐮㤷㤹㜰㈬⸱㌵㠶ㄲ‹〲㈮㘳〴㘸㈬⸱㌵㠶㈲‱㉃⸲㠷㠰㠱㈬⸱㌵㠶㈲″㈲㜮ㄳ㔹㌲㈬⸵㜰〶㘰″㈲㜮ㄳ㔹㌲㈬⸵㜰〶㘰∳椠㵤倢瑡⵨ㄷ䌭灯⵹∲猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㍍⸵〰㐵㐱ⰱ㔲〮㘷〰㌶䌠㔳〮㔰ㄴㄴ㈬⸵㜰〶㘰″㐳㜮㐴㐵㈬⸱㌵㠶ㄲ‹㜳㔮〰㔹㠷㈬⸱㌵㠶㈲‱㑃⸰㐰㌵㜶ⰲㄲ㔮㘳㈸㌲㌠⸹㤹㔶㄰ⰵ㔲〮㘷〰㌶㌠⸹㤹㔶㄰ⰵ㔲〮㘷〰㌶•摩∽慐桴㜭ⴱ潃祰•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮㸢⼼慰桴ਾ††††††††††⼼㹧 †††††††㰠术ਾ††††††⼼㹧 †††㰠术ਾ††⼼㹧㰊猯杶"`; + +exports[`"encoding" option should work with "String" right encoding value (ucs2): warnings 1`] = `Array []`; + exports[`"encoding" option should work with "String" right encoding value (utf8): assets 1`] = ` Array [ "main.bundle.js", @@ -73,17 +280,17 @@ exports[`"encoding" option should work with "String" right encoding value (utf8) exports[`"encoding" option should work with "String" right encoding value (utf8): warnings 1`] = `Array []`; -exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: assets 1`] = ` +exports[`"encoding" option should work with "String" right encoding value (utf16le): assets 1`] = ` Array [ "main.bundle.js", ] `; -exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: errors 1`] = `Array []`; +exports[`"encoding" option should work with "String" right encoding value (utf16le): errors 1`] = `Array []`; -exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjcuMSAoMjgyMTUpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPm1vY2hpPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+CiAgICAgICAgPHJlY3QgaWQ9InBhdGgtMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjcwIiByeD0iMyI+PC9yZWN0PgogICAgICAgIDxtYXNrIGlkPSJtYXNrLTIiIG1hc2tDb250ZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBtYXNrVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiB4PSIwIiB5PSIwIiB3aWR0aD0iNzAiIGhlaWdodD0iNzAiIGZpbGw9IndoaXRlIj4KICAgICAgICAgICAgPHVzZSB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAg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1saW5lam9pbj0icm91bmQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjE3NjI2MCwgMzAuODY5MTcyKSByb3RhdGUoLTE4MC4wMDAwMDApIHRyYW5zbGF0ZSgtMjkuMTc2MjYwLCAtMzAuODY5MTcyKSAiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE3Ljc0MDg2NDgsMjUuMDc2MDA2MyBDMTcuNzQwODY0OCwyNS4wNzYwMDYzIDE3LjQ3OTk5MDcsMjEuNTM2ODIxOSAyMC4yMzY0MDg2LDIxLjUzNjgyMjEgQzIyLjc4MDgxOCwyMS41MzY4MjIzIDIyLjczMTk1MjMsMjUuMDc2MDA2MyAyMi43MzE5NTIzLDI1LjA3NjAwNjMiIGlkPSJQYXRoLTcxLUNvcHktMiIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTM1LjAwNTQxNDEsMjUuMDc2MDA2MyBDMzUuMDA1NDE0MSwyNS4wNzYwMDYzIDM0Ljc0NDU0LDIxLjUzNjgyMTkgMzcuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; +exports[`"encoding" option should work with "String" right encoding value (utf16le): result 1`] = `"data:image/svg+xml;utf16le,㼼浸敶獲潩㵮ㄢ〮•湥潣楤杮∽呕ⵆ∸猠慴摮污湯㵥渢≯㸿㰊癳⁧楷瑤㵨㜢瀵≸栠楥桧㵴㜢瀵≸瘠敩䉷硯∽‰‰㔷㜠∵瘠牥楳湯∽⸱∱砠汭獮∽瑨灴⼺眯睷眮⸳牯⽧〲〰猯杶•浸湬㩳汸湩㵫栢瑴㩰⼯睷⹷㍷漮杲ㄯ㤹⼹汸湩≫ਾ††ℼⴭ䜠湥牥瑡牯›歓瑥档㌠㜮ㄮ⠠㠲ㄲ⤵ⴠ栠瑴㩰⼯睷⹷潢敨業湡潣楤杮挮浯猯敫捴⁨ⴭਾ††琼瑩敬派捯楨⼼楴汴㹥 †㰠敤捳䌾敲瑡摥眠瑩⁨歓瑥档㰮搯獥㹣 †㰠敤獦ਾ††††爼捥⁴摩∽慰桴ㄭ•㵸〢•㵹〢•楷瑤㵨㜢∰栠楥桧㵴㜢∰爠㵸㌢㸢⼼敲瑣ਾ††††洼獡摩∽慭歳㈭•慭歳潃瑮湥啴楮獴∽獵牥灓捡佥啮敳•慭歳湕瑩㵳漢橢捥䉴畯摮湩䉧硯•㵸〢•㵹〢•楷瑤㵨㜢∰栠楥桧㵴㜢∰映汩㵬眢楨整㸢 †††††㰠獵⁥汸湩㩫牨晥∽瀣瑡⵨∱㰾甯敳ਾ††††⼼慭歳ਾ††⼼敤獦ਾ††朼椠㵤倢条ⵥ∱猠牴歯㵥渢湯≥猠牴歯ⵥ楷瑤㵨ㄢ•楦汬∽潮敮•楦汬爭汵㵥攢敶潮摤㸢 †††㰠⁧摩∽潭档≩ਾ††††††朼椠㵤䜢潲灵ㄭ∵琠慲獮潦浲∽牴湡汳瑡⡥⸱〰〰〰‬⸱〰〰〰∩ਾ††††††††爼捥⁴摩∽敒瑣湡汧ⵥ㠶䌭灯⵹∷映汩㵬⌢ㄴㄴㄴ•灯捡瑩㵹〢ㄮ㤴㔰㔵㐰•㵸㌢•㵹㌢•楷瑤㵨㜢∰栠楥桧㵴㜢∰爠㵸㌢㸢⼼敲瑣ਾ††††††††甼敳椠㵤刢捥慴杮敬㘭∸猠牴歯㵥⌢㌶㌶㌶•慭歳∽牵⡬洣獡⵫⤲•瑳潲敫眭摩桴∽∵猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆砠楬歮栺敲㵦⌢慰桴ㄭ㸢⼼獵㹥 †††††††㰠⁧摩∽片畯⵰∹琠慲獮潦浲∽牴湡汳瑡⡥⸷〰〰〰‬⸸〰〰〰∩ਾ††††††††††瀼瑡⁨㵤䴢㈱㜮㠰㤷㔵㈬㜮ㄶ㘶㠷‶㑌⸱〷㜸㔹ⰵ⸲㘷㘱㜶㘸䰠㈱㜮㠰㤷㔵㈬㜮ㄶ㘶㠷‶≚椠㵤倢瑡⵨ㄴ•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•牴湡晳牯㵭琢慲獮慬整㈨⸷〲㜸㔹‬⸲㘷㘱㠶
捳污⡥ㄭ‬⤱琠慲獮慬整⴨㜲㈮㠰㤷ⰵⴠ⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††朼椠㵤䜢潲灵㜭㸢 †††††††††††㰠慰桴搠∽㍍⸱㌳㤵㐱ⰲ㔵㔮㈶㈹㠵䌠㐴㤮㈷㔳㐷㔬⸵㘵㤲㔲‸㘵〮㘲㜸㤸㐬⸴〵㐸㐰‴㘵〮㘲㜸㤸㌬⸰㜸㤱ㄶ‱㕃⸶㈰㠶㠷ⰹ㜱㈮㔳ㄵ㠷㐠⸴㜹㌲㜵ⰴ⸶㠱㤰㘹㈴㌠⸱㌳㤵㐱ⰲ⸶㠱㤰㘹㈴䌠㜱㘮㤹㜴㤰㘬ㄮ〸㤹㐶′⸶㐶㤴㤴ⰵ㜱㈮㔳ㄵ㠷㘠㘮㐴㐹㔹㌬⸰㜸㤱ㄶ‱㙃㘮㐴㐹㔹㐬⸴〵㐸㐰‴㜱㘮㤹㜴㤰㔬⸵㘵㤲㔲‸ㄳ㌮㔳ㄹ㈴㔬⸵㘵㤲㔲‸≚椠㵤伢慶⵬ㄳ䌭灯⵹∵映汩㵬⌢ㄴㄴㄴ•灯捡瑩㵹〢ㄮ㤴㔰㔵㐰㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢㠲㌮㔳ㄹ㈴㔬⸲㘵㤲㔲‸㑃⸱㜹㌲㜵ⰴ㈵㔮㈶㈹㠵㔠⸳㈰㠶㠷ⰹㄴ㔮㠰〴㐴㔠⸳㈰㠶㠷ⰹ㜲㠮ㄷ㘹ㄱ䌠㌵〮㘲㜸㤸ㄬ⸴㌲㔵㜱‸ㄴ㤮㈷㔳㐷㌬ㄮ〸㤹㐶′㠲㌮㔳ㄹ㈴㌬ㄮ〸㤹㐶′ㅃ⸴㤶㐹〷ⰹ⸳㠱㤰㘹㈴㌠㘮㐴㐹㔹ㄬ⸴㌲㔵㜱‸⸳㐶㤴㤴ⰵ㜲㠮ㄷ㘹ㄱ䌠⸳㐶㤴㤴ⰵㄴ㔮㠰〴㐴ㄠ⸴㤶㐹〷ⰹ㈵㔮㈶㈹㠵㈠⸸㌳㤵㐱ⰲ㈵㔮㈶㈹㠵娠•摩∽癏污㌭∱猠牴歯㵥⌢㌶㌶㌶•瑳潲敫眭摩桴∽⸲∵映汩㵬⌢䙆䙆䙆㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢㌲〮㤷㤴㔲㜬〮㜴㠵㤹‷ㅃ⸶〷ㄷ㈲ⰵ⸸㐷㤴㔱㤷ㄠ⸱㐶㐵㈵ⰵ㈱㤮〷〴′⸸㠹㠹㈱㠳ㄬ⸸㤴㤹ㄲ∹椠㵤倢瑡⵨ㄲ•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮㸢⼼慰桴ਾ††††††††††††攼汬灩敳椠㵤伢慶⵬㈳•楦汬∽䘣䄳䄵∵挠㵸㐢⸰㈸ㄱ㠱∴挠㵹㈢⸸㘶㔲㈰∱爠㵸㌢㔮㔷㤵㔹∸爠㵹㈢㌮㈱㘲㈶∲㰾支汬灩敳ਾ††††††††††††攼汬灩敳椠㵤伢慶⵬㈳•楦汬∽䘣䄳䄵∵挠㵸ㄢ⸷㌵㐱㈰∲挠㵹㈢⸸㤴〴㤲∸爠㵸㌢㔮㔷㤵㔹∸爠㵹㈢㌮㈱㘲㈶∲㰾支汬灩敳ਾ††††††††††††瀼瑡⁨㵤䴢㤳㌮〷㔶㈷㈬‷㙌⸸㜳㘰㜵ⰲ㜲䰠㤳㌮〷㔶㈷㈬‷≚椠㵤倢瑡⵨ㄴ•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㜲〮〰〰⤰爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㜲〮〰〰⤰∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㕍⸲ㄴㄶㄱⰷ㘲㠮㈸㌸‱㕃⸳㐱㌳㐸ⰴ㘲ㄮ㔵㔵㌸㔠⸴㤵㤷㤲ⰹ㘲ㄮ㔵㔵㌸㔠⸵㈳㈵㈰ⰶ㘲㠮㈸㌸‱㕃⸶㔰㐲㔷ⰳ㜲㘮〱〱㜳㔠⸶㔰㐲㔷ⰳ㤲〮㐶㐶㈹㔠⸵㈳㈵㈰ⰶ㤲㜮ㄹ㈹㤱䌠㐵㔮㜹㈹㤹㌬⸰ㄵㄹ㐹‶㌵ㄮ㌴㠳㐴㌬⸰ㄵㄹ㐹‶㈵㐮㘱ㄱ㜱㈬⸹㤷㤱ㄲ‹㕃⸱㠶㠸㤳㈬⸹㘰㘴㤴′ㄵ㘮㠸㌸ⰹ㜲㘮〱〱㜳㔠⸲ㄴㄶㄱⰷ㘲㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㠲㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㠲㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㕍⸲ㄴㄶㄱⰷㄱ㠮㈸㌸‱㕃⸳㐱㌳㐸ⰴㄱㄮ㔵㔵㌸㔠⸴㤵㤷㤲ⰹㄱㄮ㔵㔵㌸㔠⸵㈳㈵㈰ⰶㄱ㠮㈸㌸‱㕃⸶㔰㐲㔷ⰳ㈱㘮〱〱㜳㔠⸶㔰㐲㔷ⰳ㐱〮㐶㐶㈹㔠⸵㈳㈵㈰ⰶ㐱㜮ㄹ㈹㤱䌠㐵㔮㜹㈹㤹ㄬ⸵ㄵㄹ㐹‶㌵ㄮ㌴㠳㐴ㄬ⸵ㄵㄹ㐹‶㈵㐮㘱ㄱ㜱ㄬ⸴㤷㤱ㄲ‹㕃⸱㠶㠸㤳ㄬ⸴㘰㘴㤴′ㄵ㘮㠸㌸ⰹ㈱㘮〱〱㜳㔠⸲ㄴㄶㄱⰷㄱ㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㌱㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㌱㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㕍⸲ㄴㄶㄱⰷㄴ㠮㈸㌸‱㕃⸳㐱㌳㐸ⰴㄴㄮ㔵㔵㌸㔠⸴㤵㤷㤲ⰹㄴㄮ㔵㔵㌸㔠⸵㈳㈵㈰ⰶㄴ㠮㈸㌸‱㕃⸶㔰㐲㔷ⰳ㈴㘮〱〱㜳㔠⸶㔰㐲㔷ⰳ㐴〮㐶㐶㈹㔠⸵㈳㈵㈰ⰶ㐴㜮ㄹ㈹㤱䌠㐵㔮㜹㈹㤹㐬⸵ㄵㄹ㐹‶㌵ㄮ㌴㠳㐴㐬⸵ㄵㄹ㐹‶㈵㐮㘱ㄱ㜱㐬⸴㤷㤱ㄲ‹㕃⸱㠶㠸㤳㐬⸴㘰㘴㤴′ㄵ㘮㠸㌸ⰹ㈴㘮〱〱㜳㔠⸲ㄴㄶㄱⰷㄴ㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㔨⸳㜸㘰㜵‬㌴㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨㌵㠮〷㔶ⰷⴠ㌴㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ⵍㄱ㘮㤲㐳㠲㈬‷ㅌ⸷㜳㘰㜵ⰲ㜲䰠ㄭ⸱㈶㌹㈴ⰸ㜲娠•摩∽慐桴㐭∱猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤琠慲獮潦浲∽牴湡汳瑡⡥⸲㜸㘰㜵‬㜲〮〰〰⤰爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨⸲㜸㘰㜵‬㈭⸷〰〰〰
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢⸱ㄴㄶㄱⰷ㘲㠮㈸㌸‱㉃ㄮ㌴㠳㐴ⰲ㘲ㄮ㔵㔵㌸㌠㔮㜹㈹㠹ⰸ㘲ㄮ㔵㔵㌸㐠㌮㔲〲㘲ⰱ㘲㠮㈸㌸‱㕃〮㈵㜴㌵ⰳ㜲㘮〱〱㜳㔠〮㈵㜴㌵ⰳ㤲〮㐶㐶㈹㐠㌮㔲〲㘲ⰱ㤲㜮ㄹ㈹㤱䌠⸳㤵㤷㤲㠸㌬⸰ㄵㄹ㐹‶⸲㐱㌳㐸㈴㌬⸰ㄵㄹ㐹‶⸱ㄴㄶㄱⰷ㤲㜮ㄹ㈹㤱䌠⸰㠶㠸㠳㘹ⰹ㤲〮㐶㐶㈹〠㘮㠸㌸㤸㤶㈬⸷ㄶ㄰㌰‷⸱ㄴㄶㄱⰷ㘲㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㈨㠮〷㔶ⰷ㈠⸸㌳㌷㘷
潲慴整⴨㜲⸰〰〰〰
牴湡汳瑡⡥㈭㠮〷㔶ⰷⴠ㠲㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ㐮㘱ㄱ㜱ㄬ⸱㠸㠲ㄳ䌠⸲㐱㌳㐸㈴ㄬ⸱㔱㔵㠵″⸳㤵㤷㤲㠸ㄬ⸱㔱㔵㠵″⸴㈳㈵㈰ㄶㄬ⸱㠸㠲ㄳ䌠⸵㔰㐲㔷㌳ㄬ⸲ㄶ㄰㌰‷⸵㔰㐲㔷㌳ㄬ⸴㘰㘴㤴′⸴㈳㈵㈰ㄶㄬ⸴㤷㤱ㄲ‹㍃㔮㜹㈹㠹ⰸ㔱㔮㤱㤱㘴㈠ㄮ㌴㠳㐴ⰲ㔱㔮㤱㤱㘴ㄠ㐮㘱ㄱ㜱ㄬ⸴㤷㤱ㄲ‹ぃ㘮㠸㌸㤸㤶ㄬ⸴㘰㘴㤴′⸰㠶㠸㠳㘹ⰹ㈱㘮〱〱㜳ㄠ㐮㘱ㄱ㜱ㄬ⸱㠸㠲ㄳ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥⸲㜸㘰㜵‬㌱㌮㜳㜳⤶爠瑯瑡⡥㈭〷〮〰〰⤰琠慲獮慬整⴨⸲㜸㘰㜵‬ㄭ⸳㌳㌷㘷
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢⸱ㄴㄶㄱⰷㄴ㠮㈸㌸‱㉃ㄮ㌴㠳㐴ⰲㄴㄮ㔵㔵㌸㌠㔮㜹㈹㠹ⰸㄴㄮ㔵㔵㌸㐠㌮㔲〲㘲ⰱㄴ㠮㈸㌸‱㕃〮㈵㜴㌵ⰳ㈴㘮〱〱㜳㔠〮㈵㜴㌵ⰳ㐴〮㐶㐶㈹㐠㌮㔲〲㘲ⰱ㐴㜮ㄹ㈹㤱䌠⸳㤵㤷㤲㠸㐬⸵ㄵㄹ㐹‶⸲㐱㌳㐸㈴㐬⸵ㄵㄹ㐹‶⸱ㄴㄶㄱⰷ㐴㜮ㄹ㈹㤱䌠⸰㠶㠸㠳㘹ⰹ㐴〮㐶㐶㈹〠㘮㠸㌸㤸㤶㐬⸲ㄶ㄰㌰‷⸱ㄴㄶㄱⰷㄴ㠮㈸㌸‱≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㈨㠮〷㔶ⰷ㐠⸳㌳㌷㘷
潲慴整⴨㜲⸰〰〰〰
牴湡汳瑡⡥㈭㠮〷㔶ⰷⴠ㌴㌮㜳㜳⤶∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ⸲〷㜸㔹ⰵ㈵㜮ㄶ㘶㤷䰠ㄴ㜮㠰㤷㔵㔬⸲㘷㘱㜶‹ㅌ⸲〷㜸㔹ⰵ㈵㜮ㄶ㘶㤷娠•摩∽慐桴㐭∱猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤琠慲獮潦浲∽牴湡汳瑡⡥㜲㈮㠰㤷ⰵ㔠⸲㘷㘱㠶
捳污⡥ㄭ‬⤱琠慲獮慬整⴨㜲㈮㠰㤷ⰵⴠ㈵㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㉍⸶㤷㘴㌳㔬⸱〳ㄷ㈲‴㉃⸷㈵㤱㔰ⰷ〵㔮㤷㐸㜹㈠⸸㜹㐶ㄵⰱ〵㔮㤷㐸㜹㈠⸹〷㜳㌲ⰹㄵ㌮㜰㈱㐲䌠〳㐮〳㤹㘶㔬⸲㌰㌴㔹‱〳㐮〳㤹㘶㔬⸳㠴㤸〴‶㤲㜮㌰㈷㤳㔬⸴ㄲ㈶㌱″㉃⸸㜹㐶ㄵⰱ㐵㤮㌴㠴‶㜲㔮ㄲ〹㜵㔬⸴㐹㐳㘸㈠⸶㤷㘴㌳㔬⸴ㄲ㈶㌱″㉃⸶㘰㌷〶ⰲ㌵㐮㠸㐹㘰㈠⸶㘰㌷〶ⰲ㈵〮㐳㤳ㄵ㈠⸶㤷㘴㌳㔬⸱〳ㄷ㈲‴≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㈨⸸㐲ㄹ㠷‬㈵㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㈭⸸㐲ㄹ㠷‬㔭⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢ㄴ㜮㘹㔷㔬⸱〳ㄷ㈲‴㑃⸲㈵〴㈲ⰸ〵㔮㤷㐸㜹㐠⸳㜹㔸㠶ⰲ〵㔮㤷㐸㜹㐠⸴〷㠵〴ⰹㄵ㌮㜰㈱㐲䌠㔴㐮㌳ㄱ㜳㔬⸲㌰㌴㔹‱㔴㐮㌳ㄱ㜳㔬⸳㠴㤸〴‶㐴㜮㔰㐸㤰㔬⸴ㄲ㈶㌱″㑃⸳㜹㔸㠶ⰲ㐵㤮㌴㠴‶㈴㔮㐲㈰㠲㔬⸴㐹㐳㘸㐠⸱㤷㜶ⰵ㐵㈮㘱ㄲ㌳䌠ㄴ〮㤶㜴㌷㔬⸳㠴㤸〴‶ㄴ〮㤶㜴㌷㔬⸲㌰㌴㔹‱ㄴ㜮㘹㔷㔬⸱〳ㄷ㈲‴≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整㐨⸳㔲㈱㔹‬㈵㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㐭⸳㔲㈱㔹‬㔭⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢〱㜮㘹㔷㔬⸱〳ㄷ㈲‴ㅃ⸱㈵〴㈲ⰸ〵㔮㤷㐸㜹ㄠ⸲㜹㔸㠶ⰲ〵㔮㤷㐸㜹ㄠ⸳〷㠵〴ⰹㄵ㌮㜰㈱㐲䌠㐱㐮㌳ㄱ㜳㔬⸲㌰㌴㔹‱㐱㐮㌳ㄱ㜳㔬⸳㠴㤸〴‶㌱㜮㔰㐸㤰㔬⸴ㄲ㈶㌱″ㅃ⸲㜹㔸㠶ⰲ㐵㤮㌴㠴‶ㄱ㔮㐲㈰㠲㔬⸴㐹㐳㘸ㄠ⸰㤷㜶ⰵ㐵㈮㘱ㄲ㌳䌠〱〮㤶㜴㌷㔬⸳㠴㤸〴‶〱〮㤶㜴㌷㔬⸲㌰㌴㔹‱〱㜮㘹㔷㔬⸱〳ㄷ㈲‴≚椠㵤刢捥慴杮敬㌭∰猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤映汩㵬⌢䙆䙆䙆•牴湡晳牯㵭琢慲獮慬整ㄨ⸲㔲㈱㔹‬㈵㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥ㄭ⸲㔲㈱㔹‬㔭⸲㘷㘱㠶
㸢⼼慰桴ਾ††††††††††††瀼瑡⁨㵤䴢㘲㜮㐹㌶ⰳ⸱〳ㄷ㈲ㄴ䌠㜲㔮ㄲ〹㜵〬㔮㤷㐸㘹㠷㈠⸸㜹㐶ㄵⰱ⸰㜵㠹㤴㜶‸㤲㜮㌰㈷㤳ㄬ㌮㜰㈱㐲‱㍃⸰㌴㤰㘹ⰶ⸲㌰㌴㔹㌱㌠⸰㌴㤰㘹ⰶ⸳㠴㤸〴㤵㈠⸹〷㜳㌲ⰹ⸴ㄲ㈶㌱ㄳ䌠㠲㤮㘷㔴ㄱ㐬㤮㌴㠴〶‴㜲㔮ㄲ〹㜵㐬㤮㌴㠴〶‴㘲㜮㐹㌶ⰳ⸴ㄲ㈶㌱ㄳ䌠㘲〮㜶㘳㈰㌬㐮㠸㐹㔰‹㘲〮㜶㘳㈰㈬〮㐳㤳ㄵ″㘲㜮㐹㌶ⰳ⸱〳ㄷ㈲ㄴ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥㠲㈮㤴㜱ⰸ㈠㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㈭⸸㐲ㄹ㠷‬㈭㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㑍⸱㤷㜶ⰵ⸱〳ㄷ㈲ㄴ䌠㈴㔮㐲㈰㠲〬㔮㤷㐸㘹㠷㐠⸳㜹㔸㠶ⰲ⸰㜵㠹㤴㜶‸㐴㜮㔰㐸㤰ㄬ㌮㜰㈱㐲‱㑃⸵㌴ㄳ㌱ⰷ⸲㌰㌴㔹㌱㐠⸵㌴ㄳ㌱ⰷ⸳㠴㤸〴㤵㐠⸴〷㠵〴ⰹ⸴ㄲ㈶㌱ㄳ䌠㌴㤮㠷㘵㈸㐬㤮㌴㠴〶‴㈴㔮㐲㈰㠲㐬㤮㌴㠴〶‴ㄴ㜮㘹㔷㐬㈮㘱ㄲ㌳‱㑃⸱㘰㐹㜷ⰳ⸳㠴㤸〴㤵㐠⸱㘰㐹㜷ⰳ⸲㌰㌴㔹㌱㐠⸱㤷㜶ⰵ⸱〳ㄷ㈲ㄴ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥㌴㈮ㄵ㤲ⰵ㈠㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥㐭⸳㔲㈱㔹‬㈭㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ⸰㤷㜶ⰵ⸱〳ㄷ㈲ㄴ䌠ㄱ㔮㐲㈰㠲〬㔮㤷㐸㘹㠷ㄠ⸲㜹㔸㠶ⰲ⸰㜵㠹㤴㜶‸㌱㜮㔰㐸㤰ㄬ㌮㜰㈱㐲‱ㅃ⸴㌴ㄳ㌱ⰷ⸲㌰㌴㔹㌱ㄠ⸴㌴ㄳ㌱ⰷ⸳㠴㤸〴㤵ㄠ⸳〷㠵〴ⰹ⸴ㄲ㈶㌱ㄳ䌠㈱㤮㠷㘵㈸㐬㤮㌴㠴〶‴ㄱ㔮㐲㈰㠲㐬㤮㌴㠴〶‴〱㜮㘹㔷㐬㈮㘱ㄲ㌳‱ㅃ⸰㘰㐹㜷ⰳ⸳㠴㤸〴㤵ㄠ⸰㘰㐹㜷ⰳ⸲㌰㌴㔹㌱ㄠ⸰㤷㜶ⰵ⸱〳ㄷ㈲ㄴ娠•摩∽敒瑣湡汧ⵥ〳•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•楦汬∽䘣䙆䙆≆琠慲獮潦浲∽牴湡汳瑡⡥㈱㈮ㄵ㤲ⰵ㈠㜮ㄶ㘶⤸猠慣敬⴨ⰱㄠ
牴湡汳瑡⡥ㄭ⸲㔲㈱㔹‬㈭㜮ㄶ㘶⤸∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㉍⸶㔸㌷㔰ⰲㄳ㤮㌰㈲㌰䌠㘲㠮㜵〳㈵㌬⸰㈸㐴㈰‹㜲㜮㔱㘳ⰲ㤲㜮㌵㔷㤲㈠⸹㘱ㄴ〳ⰲ㤲㜮㌵㔷″㍃⸰ㄶ㠲㠹ⰵ㤲㜮㌵㔷″ㄳ㐮㔹ㄲ㐵㌬⸰㘸㠴㘷‸ㄳ㐮㔹ㄲ㐵㌬⸱㠹㔴ㄹ∴椠㵤倢瑡⵨㠱ⴵ潃祰•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮•牴湡晳牯㵭琢慲獮慬整㈨⸹㜱㈶〶‬〳㠮㤶㜱⤲爠瑯瑡⡥ㄭ〸〮〰〰⤰琠慲獮慬整⴨㤲ㄮ㘷㘲ⰰⴠ〳㠮㤶㜱⤲∠㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽ㅍ⸷㐷㠰㐶ⰸ㔲〮㘷〰㌶䌠㜱㜮〴㘸㠴㈬⸵㜰〶㘰″㜱㐮㤷㤹㜰㈬⸱㌵㠶ㄲ‹〲㈮㘳〴㘸㈬⸱㌵㠶㈲‱㉃⸲㠷㠰㠱㈬⸱㌵㠶㈲″㈲㜮ㄳ㔹㌲㈬⸵㜰〶㘰″㈲㜮ㄳ㔹㌲㈬⸵㜰〶㘰∳椠㵤倢瑡⵨ㄷ䌭灯⵹∲猠牴歯㵥⌢㌶㌶㌶•瑳潲敫氭湩捥灡∽潲湵≤猠牴歯ⵥ楬敮潪湩∽潲湵≤㰾瀯瑡㹨 †††††††††††㰠慰桴搠∽㍍⸵〰㐵㐱ⰱ㔲〮㘷〰㌶䌠㔳〮㔰ㄴㄴ㈬⸵㜰〶㘰″㐳㜮㐴㐵㈬⸱㌵㠶ㄲ‹㜳㔮〰㔹㠷㈬⸱㌵㠶㈲‱㑃⸰㐰㌵㜶ⰲㄲ㔮㘳㈸㌲㌠⸹㤹㔶㄰ⰵ㔲〮㘷〰㌶㌠⸹㤹㔶㄰ⰵ㔲〮㘷〰㌶•摩∽慐桴㜭ⴱ潃祰•瑳潲敫∽㘣㘳㘳∳猠牴歯ⵥ楬敮慣㵰爢畯摮•瑳潲敫氭湩橥楯㵮爢畯摮㸢⼼慰桴ਾ††††††††††⼼㹧 †††††††㰠术ਾ††††††⼼㹧 †††㰠术ਾ††⼼㹧㰊猯杶"`; -exports[`"encoding" option should work with "String" wrong value equal to xyz by falling back to base64 encoding: warnings 1`] = `Array []`; +exports[`"encoding" option should work with "String" right encoding value (utf16le): warnings 1`] = `Array []`; exports[`"encoding" option should work with unspecified value with the default base64 encoding: assets 1`] = ` Array [ diff --git a/test/encoding-option.test.js b/test/encoding-option.test.js index 8c308b7..a21ead7 100644 --- a/test/encoding-option.test.js +++ b/test/encoding-option.test.js @@ -53,9 +53,73 @@ describe('"encoding" option', () => { expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "String" wrong value equal to xyz by falling back to base64 encoding', async () => { + it('should work with "String" right encoding value (utf16le)', async () => { const compiler = getCompiler('simple-svg.js', { - encoding: 'xyz', + encoding: 'utf16le', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "String" right encoding value (latin1)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'latin1', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "String" right encoding value (base64)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'base64', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "String" right encoding value (ascii)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'ascii', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "String" right encoding value (binary)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'binary', }); const stats = await compile(compiler); @@ -68,4 +132,34 @@ describe('"encoding" option', () => { ); expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); + + it('should work with "String" right encoding value (ucs2)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'ucs2', + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should throw an error with "String" wrong encoding value equal to xyz', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: 'xyz', + }); + const stats = await compile(compiler); + + try { + execute(readAsset('main.bundle.js', compiler, stats)); + expect(true).toBe(false); + } catch (err) { + expect(err.message.indexOf('ValidationError')).not.toBe(-1); + } + }); }); From c94d8e8f6f92c2c10bbc7d78973779d76d4d1007 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 12:20:54 +0200 Subject: [PATCH 03/15] docs: fix url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12d4b5a..069c69a 100644 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ module.exports = { Type: `String` Default: `base64` -Specify the encoding which the file will be in-lined with. It supports (Node.js Buffers and Character Encodings)[https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings] which are `["utf8","utf16le","latin1","base64","hex","ascii","binary","ucs2"]`. +Specify the encoding which the file will be in-lined with. It supports [Node.js Buffers and Character Encodings](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings) which are `["utf8","utf16le","latin1","base64","hex","ascii","binary","ucs2"]`. **webpack.config.js** From 6b827faf270b9f2e66259cb7c441a3debcfe0e71 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 13:33:28 +0200 Subject: [PATCH 04/15] feat: add source option --- README.md | 57 ++++++++++++ package-lock.json | 5 ++ package.json | 1 + src/index.js | 8 +- src/options.json | 4 + test/__snapshots__/source-option.test.js.snap | 86 +++++++++++++++++++ test/source-option.test.js | 55 ++++++++++++ 7 files changed, 213 insertions(+), 3 deletions(-) create mode 100644 test/__snapshots__/source-option.test.js.snap create mode 100644 test/source-option.test.js diff --git a/README.md b/README.md index 069c69a..bece6fb 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,63 @@ module.exports = { }; ``` +### `source` + +Type: `Function` +Default: `data:${mimetype || ''};${encoding},${src.toString(encoding)}` + +You can create you own custom implementation for encoding data. in the example we are compressing svg files using [mini-svg-data-uri](https://github.com/tigt/mini-svg-data-uri) implementation. + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.svg$/i, + use: [ + { + loader: 'url-loader', + options: { + source: (svgContent) => { + const svgToMiniDataURI = require('mini-svg-data-uri'); + + return svgToMiniDataURI(svgContent); + }, + }, + }, + ], + }, + ], + }, +}; +``` + +By using your own implementation, `mimetype` and `encoding` won't have effect on the final output. until you specify them in the output manually for Example: + +```js +module.exports = { + module: { + rules: [ + { + test: /\.svg$/i, + use: [ + { + loader: 'url-loader', + options: { + source: (svgContent) => { + return `data:image/svg;utf8,${svgContent}`; + }, + }, + }, + ], + }, + ], + }, +}; +``` + ### `esModule` Type: `Boolean` diff --git a/package-lock.json b/package-lock.json index 12dda16..0568f8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10284,6 +10284,11 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "mini-svg-data-uri": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.1.3.tgz", + "integrity": "sha512-EeKOmdzekjdPe53/GdxmUpNgDQFkNeSte6XkJmOBt4BfWL6FQ9G9RtLNh+JMjFS3LhdpSICMIkZdznjiecASHQ==" + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", diff --git a/package.json b/package.json index 3daef34..7648c65 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "dependencies": { "loader-utils": "^2.0.0", "mime-types": "^2.1.26", + "mini-svg-data-uri": "^1.1.3", "schema-utils": "^2.6.5" }, "devDependencies": { diff --git a/src/index.js b/src/index.js index 579ac75..81b81e2 100644 --- a/src/index.js +++ b/src/index.js @@ -46,11 +46,13 @@ export default function loader(src) { const esModule = typeof options.esModule !== 'undefined' ? options.esModule : true; + const encodedData = options.source + ? options.source(src) + : `data:${mimetype || ''};${encoding},${src.toString(encoding)}`; + return `${ esModule ? 'export default' : 'module.exports =' - } ${JSON.stringify( - `data:${mimetype || ''};${encoding},${src.toString(encoding)}` - )}`; + } ${JSON.stringify(encodedData)}`; } // Normalize the fallback. diff --git a/src/options.json b/src/options.json index f0d1081..c59422c 100644 --- a/src/options.json +++ b/src/options.json @@ -19,6 +19,10 @@ "ucs2" ] }, + "source": { + "description": "Adding custom implementation for encoding files.", + "instanceof": "Function" + }, "mimetype": { "description": "The MIME type for the file to be transformed (https://github.com/webpack-contrib/url-loader#mimetype).", "type": "string" diff --git a/test/__snapshots__/source-option.test.js.snap b/test/__snapshots__/source-option.test.js.snap new file mode 100644 index 0000000..9951154 --- /dev/null +++ b/test/__snapshots__/source-option.test.js.snap @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: errors 1`] = `Array []`; + +exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: result 1`] = `"data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e %3csvg width='75px' height='75px' viewBox='0 0 75 75' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3c!-- Generator: Sketch 3.7.1 (28215) - http://www.bohemiancoding.com/sketch --%3e %3ctitle%3emochi%3c/title%3e %3cdesc%3eCreated with Sketch.%3c/desc%3e %3cdefs%3e %3crect id='path-1' x='0' y='0' width='70' height='70' rx='3'%3e%3c/rect%3e %3cmask id='mask-2' maskContentUnits='userSpaceOnUse' maskUnits='objectBoundingBox' x='0' y='0' width='70' height='70' fill='white'%3e %3cuse xlink:href='%23path-1'%3e%3c/use%3e %3c/mask%3e %3c/defs%3e %3cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e %3cg id='mochi'%3e %3cg id='Group-15' transform='translate(1.000000%2c 1.000000)'%3e %3crect id='Rectangle-68-Copy-7' fill='%23414141' opacity='0.149055504' x='3' y='3' width='70' height='70' rx='3'%3e%3c/rect%3e %3cuse id='Rectangle-68' stroke='%23636363' mask='url(%23mask-2)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' fill='white' xlink:href='%23path-1'%3e%3c/use%3e %3cg id='Group-9' transform='translate(7.000000%2c 8.000000)'%3e %3cpath d='M12.7087955%2c2.76166786 L41.7087955%2c2.76166786 L12.7087955%2c2.76166786 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 2.761668) scale(-1%2c 1) translate(-27.208795%2c -2.761668) '%3e%3c/path%3e %3cg id='Group-7'%3e %3cpath d='M31.3359142%2c55.5629258 C44.9723574%2c55.5629258 56.0268789%2c44.5084044 56.0268789%2c30.8719611 C56.0268789%2c17.2355178 44.9723574%2c6.18099642 31.3359142%2c6.18099642 C17.6994709%2c6.18099642 6.6449495%2c17.2355178 6.6449495%2c30.8719611 C6.6449495%2c44.5084044 17.6994709%2c55.5629258 31.3359142%2c55.5629258 Z' id='Oval-31-Copy-5' fill='%23414141' opacity='0.149055504'%3e%3c/path%3e %3cpath d='M28.3359142%2c52.5629258 C41.9723574%2c52.5629258 53.0268789%2c41.5084044 53.0268789%2c27.8719611 C53.0268789%2c14.2355178 41.9723574%2c3.18099642 28.3359142%2c3.18099642 C14.6994709%2c3.18099642 3.6449495%2c14.2355178 3.6449495%2c27.8719611 C3.6449495%2c41.5084044 14.6994709%2c52.5629258 28.3359142%2c52.5629258 Z' id='Oval-31' stroke='%23636363' stroke-width='2.5' fill='white'%3e%3c/path%3e %3cpath d='M23.0794925%2c7.04758997 C16.7071225%2c8.74491579 11.6454525%2c12.970402 8.98981238%2c18.4999219' id='Path-21' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='40.8211184' cy='28.6625021' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='17.5314022' cy='28.4940298' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cpath d='M39.3706572%2c27 L68.3706572%2c27 L39.3706572%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(53.870657%2c 27.000000) rotate(-270.000000) translate(-53.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M52.4161117%2c26.882831 C53.1433844%2c26.1555583 54.5979299%2c26.1555583 55.3252026%2c26.882831 C56.0524753%2c27.6101037 56.0524753%2c29.0646492 55.3252026%2c29.7919219 C54.5979299%2c30.5191946 53.1433844%2c30.5191946 52.4161117%2c29.7919219 C51.688839%2c29.0646492 51.688839%2c27.6101037 52.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 28.337376) rotate(-270.000000) translate(-53.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c11.882831 C53.1433844%2c11.1555583 54.5979299%2c11.1555583 55.3252026%2c11.882831 C56.0524753%2c12.6101037 56.0524753%2c14.0646492 55.3252026%2c14.7919219 C54.5979299%2c15.5191946 53.1433844%2c15.5191946 52.4161117%2c14.7919219 C51.688839%2c14.0646492 51.688839%2c12.6101037 52.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 13.337376) rotate(-270.000000) translate(-53.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c41.882831 C53.1433844%2c41.1555583 54.5979299%2c41.1555583 55.3252026%2c41.882831 C56.0524753%2c42.6101037 56.0524753%2c44.0646492 55.3252026%2c44.7919219 C54.5979299%2c45.5191946 53.1433844%2c45.5191946 52.4161117%2c44.7919219 C51.688839%2c44.0646492 51.688839%2c42.6101037 52.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 43.337376) rotate(-270.000000) translate(-53.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M-11.6293428%2c27 L17.3706572%2c27 L-11.6293428%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(2.870657%2c 27.000000) rotate(-270.000000) translate(-2.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M1.4161117%2c26.882831 C2.14338442%2c26.1555583 3.59792988%2c26.1555583 4.32520261%2c26.882831 C5.05247533%2c27.6101037 5.05247533%2c29.0646492 4.32520261%2c29.7919219 C3.59792988%2c30.5191946 2.14338442%2c30.5191946 1.4161117%2c29.7919219 C0.688838969%2c29.0646492 0.688838969%2c27.6101037 1.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 28.337376) rotate(-270.000000) translate(-2.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c11.882831 C2.14338442%2c11.1555583 3.59792988%2c11.1555583 4.32520261%2c11.882831 C5.05247533%2c12.6101037 5.05247533%2c14.0646492 4.32520261%2c14.7919219 C3.59792988%2c15.5191946 2.14338442%2c15.5191946 1.4161117%2c14.7919219 C0.688838969%2c14.0646492 0.688838969%2c12.6101037 1.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 13.337376) rotate(-270.000000) translate(-2.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c41.882831 C2.14338442%2c41.1555583 3.59792988%2c41.1555583 4.32520261%2c41.882831 C5.05247533%2c42.6101037 5.05247533%2c44.0646492 4.32520261%2c44.7919219 C3.59792988%2c45.5191946 2.14338442%2c45.5191946 1.4161117%2c44.7919219 C0.688838969%2c44.0646492 0.688838969%2c42.6101037 1.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 43.337376) rotate(-270.000000) translate(-2.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M12.7087955%2c52.7616679 L41.7087955%2c52.7616679 L12.7087955%2c52.7616679 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 52.761668) scale(-1%2c 1) translate(-27.208795%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c51.3071224 C27.5219057%2c50.5798497 28.9764511%2c50.5798497 29.7037239%2c51.3071224 C30.4309966%2c52.0343951 30.4309966%2c53.4889406 29.7037239%2c54.2162133 C28.9764511%2c54.943486 27.5219057%2c54.943486 26.794633%2c54.2162133 C26.0673602%2c53.4889406 26.0673602%2c52.0343951 26.794633%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 52.761668) scale(-1%2c 1) translate(-28.249178%2c -52.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c51.3071224 C42.5240228%2c50.5798497 43.9785682%2c50.5798497 44.7058409%2c51.3071224 C45.4331137%2c52.0343951 45.4331137%2c53.4889406 44.7058409%2c54.2162133 C43.9785682%2c54.943486 42.5240228%2c54.943486 41.79675%2c54.2162133 C41.0694773%2c53.4889406 41.0694773%2c52.0343951 41.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 52.761668) scale(-1%2c 1) translate(-43.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c51.3071224 C11.5240228%2c50.5798497 12.9785682%2c50.5798497 13.7058409%2c51.3071224 C14.4331137%2c52.0343951 14.4331137%2c53.4889406 13.7058409%2c54.2162133 C12.9785682%2c54.943486 11.5240228%2c54.943486 10.79675%2c54.2162133 C10.0694773%2c53.4889406 10.0694773%2c52.0343951 10.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 52.761668) scale(-1%2c 1) translate(-12.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c1.30712241 C27.5219057%2c0.579849678 28.9764511%2c0.579849678 29.7037239%2c1.30712241 C30.4309966%2c2.03439513 30.4309966%2c3.48894059 29.7037239%2c4.21621331 C28.9764511%2c4.94348604 27.5219057%2c4.94348604 26.794633%2c4.21621331 C26.0673602%2c3.48894059 26.0673602%2c2.03439513 26.794633%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 2.761668) scale(-1%2c 1) translate(-28.249178%2c -2.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c1.30712241 C42.5240228%2c0.579849678 43.9785682%2c0.579849678 44.7058409%2c1.30712241 C45.4331137%2c2.03439513 45.4331137%2c3.48894059 44.7058409%2c4.21621331 C43.9785682%2c4.94348604 42.5240228%2c4.94348604 41.79675%2c4.21621331 C41.0694773%2c3.48894059 41.0694773%2c2.03439513 41.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 2.761668) scale(-1%2c 1) translate(-43.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c1.30712241 C11.5240228%2c0.579849678 12.9785682%2c0.579849678 13.7058409%2c1.30712241 C14.4331137%2c2.03439513 14.4331137%2c3.48894059 13.7058409%2c4.21621331 C12.9785682%2c4.94348604 11.5240228%2c4.94348604 10.79675%2c4.21621331 C10.0694773%2c3.48894059 10.0694773%2c2.03439513 10.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 2.761668) scale(-1%2c 1) translate(-12.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M26.8573052%2c31.9032203 C26.8573052%2c30.8244029 27.715362%2c29.7537529 29.1641302%2c29.753753 C30.6128985%2c29.753753 31.4952154%2c30.8648768 31.4952154%2c31.9845914' id='Path-185-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(29.176260%2c 30.869172) rotate(-180.000000) translate(-29.176260%2c -30.869172) '%3e%3c/path%3e %3cpath d='M17.7408648%2c25.0760063 C17.7408648%2c25.0760063 17.4799907%2c21.5368219 20.2364086%2c21.5368221 C22.780818%2c21.5368223 22.7319523%2c25.0760063 22.7319523%2c25.0760063' id='Path-71-Copy-2' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cpath d='M35.0054141%2c25.0760063 C35.0054141%2c25.0760063 34.74454%2c21.5368219 37.5009578%2c21.5368221 C40.0453672%2c21.5368223 39.9965015%2c25.0760063 39.9965015%2c25.0760063' id='Path-71-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/svg%3e"`; + +exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: warnings 1`] = `Array []`; + +exports[`"source" option should work with "Function" that return the encoding manually: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"source" option should work with "Function" that return the encoding manually: errors 1`] = `Array []`; + +exports[`"source" option should work with "Function" that return the encoding manually: result 1`] = ` +"data:image/svg+xml;utf8, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"source" option should work with "Function" that return the encoding manually: warnings 1`] = `Array []`; + +exports[`"source" option should work with unspecified value with the default base64 encoding: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"source" option should work with unspecified value with the default base64 encoding: errors 1`] = `Array []`; + +exports[`"source" option should work with unspecified value with the default base64 encoding: result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjcuMSAoMjgyMTUpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPm1vY2hpPC90aXRsZT4KICAgIDxkZXN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cuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; + +exports[`"source" option should work with unspecified value with the default base64 encoding: warnings 1`] = `Array []`; diff --git a/test/source-option.test.js b/test/source-option.test.js new file mode 100644 index 0000000..64137a8 --- /dev/null +++ b/test/source-option.test.js @@ -0,0 +1,55 @@ +import { + compile, + execute, + getCompiler, + normalizeErrors, + readAsset, +} from './helpers'; + +const svgToMiniDataURI = require('mini-svg-data-uri'); + +describe('"source" option', () => { + it('should work with unspecified value with the default base64 encoding', async () => { + const compiler = getCompiler('simple-svg.js'); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + it('should work with "Function" right mini-svg-data-uri encoding', async () => { + const compiler = getCompiler('simple-svg.js', { + source: (file) => svgToMiniDataURI(file.toString()), + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + it('should work with "Function" that return the encoding manually', async () => { + const compiler = getCompiler('simple-svg.js', { + source: (content) => `data:image/svg+xml;utf8,${content}`, + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); +}); From 18e6e9d485d26701c4e7e9f2930694503f557059 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 14:19:10 +0200 Subject: [PATCH 05/15] fix: remove dependancies --- package-lock.json | 5 ----- package.json | 1 - src/index.js | 2 +- test/__snapshots__/source-option.test.js.snap | 8 ++++---- test/helpers/customSourceImplementation.js | 3 +++ test/helpers/index.js | 10 +++++++++- test/source-option.test.js | 7 +++---- 7 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 test/helpers/customSourceImplementation.js diff --git a/package-lock.json b/package-lock.json index 0568f8f..12dda16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10284,11 +10284,6 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, - "mini-svg-data-uri": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.1.3.tgz", - "integrity": "sha512-EeKOmdzekjdPe53/GdxmUpNgDQFkNeSte6XkJmOBt4BfWL6FQ9G9RtLNh+JMjFS3LhdpSICMIkZdznjiecASHQ==" - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", diff --git a/package.json b/package.json index 7648c65..3daef34 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "dependencies": { "loader-utils": "^2.0.0", "mime-types": "^2.1.26", - "mini-svg-data-uri": "^1.1.3", "schema-utils": "^2.6.5" }, "devDependencies": { diff --git a/src/index.js b/src/index.js index 81b81e2..ddacc43 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ export default function loader(src) { typeof options.esModule !== 'undefined' ? options.esModule : true; const encodedData = options.source - ? options.source(src) + ? options.source(src.toString()) : `data:${mimetype || ''};${encoding},${src.toString(encoding)}`; return `${ diff --git a/test/__snapshots__/source-option.test.js.snap b/test/__snapshots__/source-option.test.js.snap index 9951154..ce7c0a9 100644 --- a/test/__snapshots__/source-option.test.js.snap +++ b/test/__snapshots__/source-option.test.js.snap @@ -1,16 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: assets 1`] = ` +exports[`"source" option should work with "Function" right custom source implementation for encoding: assets 1`] = ` Array [ "main.bundle.js", ] `; -exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: errors 1`] = `Array []`; +exports[`"source" option should work with "Function" right custom source implementation for encoding: errors 1`] = `Array []`; -exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: result 1`] = `"data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e %3csvg width='75px' height='75px' viewBox='0 0 75 75' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3c!-- Generator: Sketch 3.7.1 (28215) - http://www.bohemiancoding.com/sketch --%3e %3ctitle%3emochi%3c/title%3e %3cdesc%3eCreated with Sketch.%3c/desc%3e %3cdefs%3e %3crect id='path-1' x='0' y='0' width='70' height='70' rx='3'%3e%3c/rect%3e %3cmask id='mask-2' maskContentUnits='userSpaceOnUse' maskUnits='objectBoundingBox' x='0' y='0' width='70' height='70' fill='white'%3e %3cuse xlink:href='%23path-1'%3e%3c/use%3e %3c/mask%3e %3c/defs%3e %3cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e %3cg id='mochi'%3e %3cg id='Group-15' transform='translate(1.000000%2c 1.000000)'%3e %3crect id='Rectangle-68-Copy-7' fill='%23414141' opacity='0.149055504' x='3' y='3' width='70' height='70' rx='3'%3e%3c/rect%3e %3cuse id='Rectangle-68' stroke='%23636363' mask='url(%23mask-2)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' fill='white' xlink:href='%23path-1'%3e%3c/use%3e %3cg id='Group-9' transform='translate(7.000000%2c 8.000000)'%3e %3cpath d='M12.7087955%2c2.76166786 L41.7087955%2c2.76166786 L12.7087955%2c2.76166786 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 2.761668) scale(-1%2c 1) translate(-27.208795%2c -2.761668) '%3e%3c/path%3e %3cg id='Group-7'%3e %3cpath d='M31.3359142%2c55.5629258 C44.9723574%2c55.5629258 56.0268789%2c44.5084044 56.0268789%2c30.8719611 C56.0268789%2c17.2355178 44.9723574%2c6.18099642 31.3359142%2c6.18099642 C17.6994709%2c6.18099642 6.6449495%2c17.2355178 6.6449495%2c30.8719611 C6.6449495%2c44.5084044 17.6994709%2c55.5629258 31.3359142%2c55.5629258 Z' id='Oval-31-Copy-5' fill='%23414141' opacity='0.149055504'%3e%3c/path%3e %3cpath d='M28.3359142%2c52.5629258 C41.9723574%2c52.5629258 53.0268789%2c41.5084044 53.0268789%2c27.8719611 C53.0268789%2c14.2355178 41.9723574%2c3.18099642 28.3359142%2c3.18099642 C14.6994709%2c3.18099642 3.6449495%2c14.2355178 3.6449495%2c27.8719611 C3.6449495%2c41.5084044 14.6994709%2c52.5629258 28.3359142%2c52.5629258 Z' id='Oval-31' stroke='%23636363' stroke-width='2.5' fill='white'%3e%3c/path%3e %3cpath d='M23.0794925%2c7.04758997 C16.7071225%2c8.74491579 11.6454525%2c12.970402 8.98981238%2c18.4999219' id='Path-21' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='40.8211184' cy='28.6625021' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='17.5314022' cy='28.4940298' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cpath d='M39.3706572%2c27 L68.3706572%2c27 L39.3706572%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(53.870657%2c 27.000000) rotate(-270.000000) translate(-53.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M52.4161117%2c26.882831 C53.1433844%2c26.1555583 54.5979299%2c26.1555583 55.3252026%2c26.882831 C56.0524753%2c27.6101037 56.0524753%2c29.0646492 55.3252026%2c29.7919219 C54.5979299%2c30.5191946 53.1433844%2c30.5191946 52.4161117%2c29.7919219 C51.688839%2c29.0646492 51.688839%2c27.6101037 52.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 28.337376) rotate(-270.000000) translate(-53.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c11.882831 C53.1433844%2c11.1555583 54.5979299%2c11.1555583 55.3252026%2c11.882831 C56.0524753%2c12.6101037 56.0524753%2c14.0646492 55.3252026%2c14.7919219 C54.5979299%2c15.5191946 53.1433844%2c15.5191946 52.4161117%2c14.7919219 C51.688839%2c14.0646492 51.688839%2c12.6101037 52.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 13.337376) rotate(-270.000000) translate(-53.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c41.882831 C53.1433844%2c41.1555583 54.5979299%2c41.1555583 55.3252026%2c41.882831 C56.0524753%2c42.6101037 56.0524753%2c44.0646492 55.3252026%2c44.7919219 C54.5979299%2c45.5191946 53.1433844%2c45.5191946 52.4161117%2c44.7919219 C51.688839%2c44.0646492 51.688839%2c42.6101037 52.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 43.337376) rotate(-270.000000) translate(-53.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M-11.6293428%2c27 L17.3706572%2c27 L-11.6293428%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(2.870657%2c 27.000000) rotate(-270.000000) translate(-2.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M1.4161117%2c26.882831 C2.14338442%2c26.1555583 3.59792988%2c26.1555583 4.32520261%2c26.882831 C5.05247533%2c27.6101037 5.05247533%2c29.0646492 4.32520261%2c29.7919219 C3.59792988%2c30.5191946 2.14338442%2c30.5191946 1.4161117%2c29.7919219 C0.688838969%2c29.0646492 0.688838969%2c27.6101037 1.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 28.337376) rotate(-270.000000) translate(-2.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c11.882831 C2.14338442%2c11.1555583 3.59792988%2c11.1555583 4.32520261%2c11.882831 C5.05247533%2c12.6101037 5.05247533%2c14.0646492 4.32520261%2c14.7919219 C3.59792988%2c15.5191946 2.14338442%2c15.5191946 1.4161117%2c14.7919219 C0.688838969%2c14.0646492 0.688838969%2c12.6101037 1.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 13.337376) rotate(-270.000000) translate(-2.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c41.882831 C2.14338442%2c41.1555583 3.59792988%2c41.1555583 4.32520261%2c41.882831 C5.05247533%2c42.6101037 5.05247533%2c44.0646492 4.32520261%2c44.7919219 C3.59792988%2c45.5191946 2.14338442%2c45.5191946 1.4161117%2c44.7919219 C0.688838969%2c44.0646492 0.688838969%2c42.6101037 1.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 43.337376) rotate(-270.000000) translate(-2.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M12.7087955%2c52.7616679 L41.7087955%2c52.7616679 L12.7087955%2c52.7616679 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 52.761668) scale(-1%2c 1) translate(-27.208795%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c51.3071224 C27.5219057%2c50.5798497 28.9764511%2c50.5798497 29.7037239%2c51.3071224 C30.4309966%2c52.0343951 30.4309966%2c53.4889406 29.7037239%2c54.2162133 C28.9764511%2c54.943486 27.5219057%2c54.943486 26.794633%2c54.2162133 C26.0673602%2c53.4889406 26.0673602%2c52.0343951 26.794633%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 52.761668) scale(-1%2c 1) translate(-28.249178%2c -52.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c51.3071224 C42.5240228%2c50.5798497 43.9785682%2c50.5798497 44.7058409%2c51.3071224 C45.4331137%2c52.0343951 45.4331137%2c53.4889406 44.7058409%2c54.2162133 C43.9785682%2c54.943486 42.5240228%2c54.943486 41.79675%2c54.2162133 C41.0694773%2c53.4889406 41.0694773%2c52.0343951 41.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 52.761668) scale(-1%2c 1) translate(-43.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c51.3071224 C11.5240228%2c50.5798497 12.9785682%2c50.5798497 13.7058409%2c51.3071224 C14.4331137%2c52.0343951 14.4331137%2c53.4889406 13.7058409%2c54.2162133 C12.9785682%2c54.943486 11.5240228%2c54.943486 10.79675%2c54.2162133 C10.0694773%2c53.4889406 10.0694773%2c52.0343951 10.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 52.761668) scale(-1%2c 1) translate(-12.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c1.30712241 C27.5219057%2c0.579849678 28.9764511%2c0.579849678 29.7037239%2c1.30712241 C30.4309966%2c2.03439513 30.4309966%2c3.48894059 29.7037239%2c4.21621331 C28.9764511%2c4.94348604 27.5219057%2c4.94348604 26.794633%2c4.21621331 C26.0673602%2c3.48894059 26.0673602%2c2.03439513 26.794633%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 2.761668) scale(-1%2c 1) translate(-28.249178%2c -2.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c1.30712241 C42.5240228%2c0.579849678 43.9785682%2c0.579849678 44.7058409%2c1.30712241 C45.4331137%2c2.03439513 45.4331137%2c3.48894059 44.7058409%2c4.21621331 C43.9785682%2c4.94348604 42.5240228%2c4.94348604 41.79675%2c4.21621331 C41.0694773%2c3.48894059 41.0694773%2c2.03439513 41.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 2.761668) scale(-1%2c 1) translate(-43.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c1.30712241 C11.5240228%2c0.579849678 12.9785682%2c0.579849678 13.7058409%2c1.30712241 C14.4331137%2c2.03439513 14.4331137%2c3.48894059 13.7058409%2c4.21621331 C12.9785682%2c4.94348604 11.5240228%2c4.94348604 10.79675%2c4.21621331 C10.0694773%2c3.48894059 10.0694773%2c2.03439513 10.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 2.761668) scale(-1%2c 1) translate(-12.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M26.8573052%2c31.9032203 C26.8573052%2c30.8244029 27.715362%2c29.7537529 29.1641302%2c29.753753 C30.6128985%2c29.753753 31.4952154%2c30.8648768 31.4952154%2c31.9845914' id='Path-185-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(29.176260%2c 30.869172) rotate(-180.000000) translate(-29.176260%2c -30.869172) '%3e%3c/path%3e %3cpath d='M17.7408648%2c25.0760063 C17.7408648%2c25.0760063 17.4799907%2c21.5368219 20.2364086%2c21.5368221 C22.780818%2c21.5368223 22.7319523%2c25.0760063 22.7319523%2c25.0760063' id='Path-71-Copy-2' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cpath d='M35.0054141%2c25.0760063 C35.0054141%2c25.0760063 34.74454%2c21.5368219 37.5009578%2c21.5368221 C40.0453672%2c21.5368223 39.9965015%2c25.0760063 39.9965015%2c25.0760063' id='Path-71-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/svg%3e"`; +exports[`"source" option should work with "Function" right custom source implementation for encoding: result 1`] = `"data:image/svg+xml, mochi Created with Sketch. "`; -exports[`"source" option should work with "Function" right mini-svg-data-uri encoding: warnings 1`] = `Array []`; +exports[`"source" option should work with "Function" right custom source implementation for encoding: warnings 1`] = `Array []`; exports[`"source" option should work with "Function" that return the encoding manually: assets 1`] = ` Array [ diff --git a/test/helpers/customSourceImplementation.js b/test/helpers/customSourceImplementation.js new file mode 100644 index 0000000..62ddf26 --- /dev/null +++ b/test/helpers/customSourceImplementation.js @@ -0,0 +1,3 @@ +export default (content) => { + return `data:image/svg+xml,${ content.trim().replace(/\s+/g, ' ')}`; +}; diff --git a/test/helpers/index.js b/test/helpers/index.js index afe19df..f48670c 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -3,5 +3,13 @@ import execute from './execute'; import getCompiler from './getCompiler'; import normalizeErrors from './normalizeErrors'; import readAsset from './readAsset'; +import customSourceImplementation from './customSourceImplementation'; -export { compile, execute, getCompiler, normalizeErrors, readAsset }; +export { + compile, + execute, + getCompiler, + normalizeErrors, + readAsset, + customSourceImplementation, +}; diff --git a/test/source-option.test.js b/test/source-option.test.js index 64137a8..ecdfc49 100644 --- a/test/source-option.test.js +++ b/test/source-option.test.js @@ -4,10 +4,9 @@ import { getCompiler, normalizeErrors, readAsset, + customSourceImplementation, } from './helpers'; -const svgToMiniDataURI = require('mini-svg-data-uri'); - describe('"source" option', () => { it('should work with unspecified value with the default base64 encoding', async () => { const compiler = getCompiler('simple-svg.js'); @@ -22,9 +21,9 @@ describe('"source" option', () => { ); expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "Function" right mini-svg-data-uri encoding', async () => { + it('should work with "Function" right custom source implementation for encoding', async () => { const compiler = getCompiler('simple-svg.js', { - source: (file) => svgToMiniDataURI(file.toString()), + source: (content) => customSourceImplementation(content), }); const stats = await compile(compiler); From 9ccc3a0a7fd42ee51bf651f9f69f886f637398a9 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 14:59:12 +0200 Subject: [PATCH 06/15] fix: allow user to manipulate Buffer instance --- README.md | 12 +++++++----- src/index.js | 2 +- test/helpers/customSourceImplementation.js | 8 +++++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bece6fb..3f9c46e 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ module.exports = { Type: `Function` Default: `data:${mimetype || ''};${encoding},${src.toString(encoding)}` -You can create you own custom implementation for encoding data. in the example we are compressing svg files using [mini-svg-data-uri](https://github.com/tigt/mini-svg-data-uri) implementation. +You can create you own custom implementation for encoding data. `source` argument is a [`Buffer`](https://nodejs.org/api/buffer.html) instance. in the example we are compressing svg files using [mini-svg-data-uri](https://github.com/tigt/mini-svg-data-uri) implementation. **webpack.config.js** @@ -255,10 +255,10 @@ module.exports = { { loader: 'url-loader', options: { - source: (svgContent) => { + source: (svgContentBuffer) => { const svgToMiniDataURI = require('mini-svg-data-uri'); - return svgToMiniDataURI(svgContent); + return svgToMiniDataURI(svgContentBuffer.toString()); }, }, }, @@ -281,8 +281,10 @@ module.exports = { { loader: 'url-loader', options: { - source: (svgContent) => { - return `data:image/svg;utf8,${svgContent}`; + source: (svgContentBuffer) => { + return `data:image/svg;utf8,${svgContentBuffer.toString( + 'utf8' + )}`; }, }, }, diff --git a/src/index.js b/src/index.js index ddacc43..81b81e2 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ export default function loader(src) { typeof options.esModule !== 'undefined' ? options.esModule : true; const encodedData = options.source - ? options.source(src.toString()) + ? options.source(src) : `data:${mimetype || ''};${encoding},${src.toString(encoding)}`; return `${ diff --git a/test/helpers/customSourceImplementation.js b/test/helpers/customSourceImplementation.js index 62ddf26..5cb9106 100644 --- a/test/helpers/customSourceImplementation.js +++ b/test/helpers/customSourceImplementation.js @@ -1,3 +1,9 @@ export default (content) => { - return `data:image/svg+xml,${ content.trim().replace(/\s+/g, ' ')}`; + return ( + `data:image/svg+xml,${ + content + .toString() + .trim() + .replace(/\s+/g, ' ')}` + ); }; From 2bb2de67e75d175c1ab7b41a075307414f8b6930 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 15:32:51 +0200 Subject: [PATCH 07/15] docs: fix an option mistake --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f9c46e..9879837 100644 --- a/README.md +++ b/README.md @@ -226,7 +226,7 @@ module.exports = { { loader: 'url-loader', options: { - mimetype: 'utf8', + encoding: 'utf8', }, }, ], From a735888bbdb89c77b2df06c7d574285d8ebcfff2 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 19:46:54 +0200 Subject: [PATCH 08/15] feat: change source to generator & update tests --- README.md | 5 +- package-lock.json | 6 ++ package.json | 1 + src/index.js | 4 +- src/options.json | 2 +- .../generator-option.test.js.snap | 86 +++++++++++++++++++ test/__snapshots__/source-option.test.js.snap | 86 ------------------- ...ption.test.js => generator-option.test.js} | 13 +-- test/helpers/customSourceImplementation.js | 9 -- test/helpers/index.js | 10 +-- 10 files changed, 106 insertions(+), 116 deletions(-) create mode 100644 test/__snapshots__/generator-option.test.js.snap delete mode 100644 test/__snapshots__/source-option.test.js.snap rename test/{source-option.test.js => generator-option.test.js} (79%) delete mode 100644 test/helpers/customSourceImplementation.js diff --git a/README.md b/README.md index 9879837..02ad2de 100644 --- a/README.md +++ b/README.md @@ -236,12 +236,11 @@ module.exports = { }; ``` -### `source` +### `generator` Type: `Function` -Default: `data:${mimetype || ''};${encoding},${src.toString(encoding)}` -You can create you own custom implementation for encoding data. `source` argument is a [`Buffer`](https://nodejs.org/api/buffer.html) instance. in the example we are compressing svg files using [mini-svg-data-uri](https://github.com/tigt/mini-svg-data-uri) implementation. +You can create you own custom implementation for encoding data. `generator` argument is a [`Buffer`](https://nodejs.org/api/buffer.html) instance of the file. in the example we are compressing svg files using [mini-svg-data-uri](https://github.com/tigt/mini-svg-data-uri) implementation. **webpack.config.js** diff --git a/package-lock.json b/package-lock.json index 12dda16..8b6b057 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10284,6 +10284,12 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "mini-svg-data-uri": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.1.3.tgz", + "integrity": "sha512-EeKOmdzekjdPe53/GdxmUpNgDQFkNeSte6XkJmOBt4BfWL6FQ9G9RtLNh+JMjFS3LhdpSICMIkZdznjiecASHQ==", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", diff --git a/package.json b/package.json index 3daef34..7f4d35e 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "jest-junit": "^10.0.0", "lint-staged": "^10.0.8", "memfs": "^3.1.2", + "mini-svg-data-uri": "^1.1.3", "npm-run-all": "^4.1.5", "prettier": "^1.19.1", "standard-version": "^7.1.0", diff --git a/src/index.js b/src/index.js index 81b81e2..2e23e60 100644 --- a/src/index.js +++ b/src/index.js @@ -46,8 +46,8 @@ export default function loader(src) { const esModule = typeof options.esModule !== 'undefined' ? options.esModule : true; - const encodedData = options.source - ? options.source(src) + const encodedData = options.generator + ? options.generator(src) : `data:${mimetype || ''};${encoding},${src.toString(encoding)}`; return `${ diff --git a/src/options.json b/src/options.json index c59422c..01068ec 100644 --- a/src/options.json +++ b/src/options.json @@ -19,7 +19,7 @@ "ucs2" ] }, - "source": { + "generator": { "description": "Adding custom implementation for encoding files.", "instanceof": "Function" }, diff --git a/test/__snapshots__/generator-option.test.js.snap b/test/__snapshots__/generator-option.test.js.snap new file mode 100644 index 0000000..bbd0bbf --- /dev/null +++ b/test/__snapshots__/generator-option.test.js.snap @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`"generator" option should work with "Function" generating encoding manually: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"generator" option should work with "Function" generating encoding manually: errors 1`] = `Array []`; + +exports[`"generator" option should work with "Function" generating encoding manually: result 1`] = ` +"data:image/svg;utf8, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"generator" option should work with "Function" generating encoding manually: warnings 1`] = `Array []`; + +exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: errors 1`] = `Array []`; + +exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: result 1`] = `"data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e %3csvg width='75px' height='75px' viewBox='0 0 75 75' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3c!-- Generator: Sketch 3.7.1 (28215) - http://www.bohemiancoding.com/sketch --%3e %3ctitle%3emochi%3c/title%3e %3cdesc%3eCreated with Sketch.%3c/desc%3e %3cdefs%3e %3crect id='path-1' x='0' y='0' width='70' height='70' rx='3'%3e%3c/rect%3e %3cmask id='mask-2' maskContentUnits='userSpaceOnUse' maskUnits='objectBoundingBox' x='0' y='0' width='70' height='70' fill='white'%3e %3cuse xlink:href='%23path-1'%3e%3c/use%3e %3c/mask%3e %3c/defs%3e %3cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e %3cg id='mochi'%3e %3cg id='Group-15' transform='translate(1.000000%2c 1.000000)'%3e %3crect id='Rectangle-68-Copy-7' fill='%23414141' opacity='0.149055504' x='3' y='3' width='70' height='70' rx='3'%3e%3c/rect%3e %3cuse id='Rectangle-68' stroke='%23636363' mask='url(%23mask-2)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' fill='white' xlink:href='%23path-1'%3e%3c/use%3e %3cg id='Group-9' transform='translate(7.000000%2c 8.000000)'%3e %3cpath d='M12.7087955%2c2.76166786 L41.7087955%2c2.76166786 L12.7087955%2c2.76166786 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 2.761668) scale(-1%2c 1) translate(-27.208795%2c -2.761668) '%3e%3c/path%3e %3cg id='Group-7'%3e %3cpath d='M31.3359142%2c55.5629258 C44.9723574%2c55.5629258 56.0268789%2c44.5084044 56.0268789%2c30.8719611 C56.0268789%2c17.2355178 44.9723574%2c6.18099642 31.3359142%2c6.18099642 C17.6994709%2c6.18099642 6.6449495%2c17.2355178 6.6449495%2c30.8719611 C6.6449495%2c44.5084044 17.6994709%2c55.5629258 31.3359142%2c55.5629258 Z' id='Oval-31-Copy-5' fill='%23414141' opacity='0.149055504'%3e%3c/path%3e %3cpath d='M28.3359142%2c52.5629258 C41.9723574%2c52.5629258 53.0268789%2c41.5084044 53.0268789%2c27.8719611 C53.0268789%2c14.2355178 41.9723574%2c3.18099642 28.3359142%2c3.18099642 C14.6994709%2c3.18099642 3.6449495%2c14.2355178 3.6449495%2c27.8719611 C3.6449495%2c41.5084044 14.6994709%2c52.5629258 28.3359142%2c52.5629258 Z' id='Oval-31' stroke='%23636363' stroke-width='2.5' fill='white'%3e%3c/path%3e %3cpath d='M23.0794925%2c7.04758997 C16.7071225%2c8.74491579 11.6454525%2c12.970402 8.98981238%2c18.4999219' id='Path-21' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='40.8211184' cy='28.6625021' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='17.5314022' cy='28.4940298' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cpath d='M39.3706572%2c27 L68.3706572%2c27 L39.3706572%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(53.870657%2c 27.000000) rotate(-270.000000) translate(-53.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M52.4161117%2c26.882831 C53.1433844%2c26.1555583 54.5979299%2c26.1555583 55.3252026%2c26.882831 C56.0524753%2c27.6101037 56.0524753%2c29.0646492 55.3252026%2c29.7919219 C54.5979299%2c30.5191946 53.1433844%2c30.5191946 52.4161117%2c29.7919219 C51.688839%2c29.0646492 51.688839%2c27.6101037 52.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 28.337376) rotate(-270.000000) translate(-53.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c11.882831 C53.1433844%2c11.1555583 54.5979299%2c11.1555583 55.3252026%2c11.882831 C56.0524753%2c12.6101037 56.0524753%2c14.0646492 55.3252026%2c14.7919219 C54.5979299%2c15.5191946 53.1433844%2c15.5191946 52.4161117%2c14.7919219 C51.688839%2c14.0646492 51.688839%2c12.6101037 52.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 13.337376) rotate(-270.000000) translate(-53.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c41.882831 C53.1433844%2c41.1555583 54.5979299%2c41.1555583 55.3252026%2c41.882831 C56.0524753%2c42.6101037 56.0524753%2c44.0646492 55.3252026%2c44.7919219 C54.5979299%2c45.5191946 53.1433844%2c45.5191946 52.4161117%2c44.7919219 C51.688839%2c44.0646492 51.688839%2c42.6101037 52.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 43.337376) rotate(-270.000000) translate(-53.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M-11.6293428%2c27 L17.3706572%2c27 L-11.6293428%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(2.870657%2c 27.000000) rotate(-270.000000) translate(-2.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M1.4161117%2c26.882831 C2.14338442%2c26.1555583 3.59792988%2c26.1555583 4.32520261%2c26.882831 C5.05247533%2c27.6101037 5.05247533%2c29.0646492 4.32520261%2c29.7919219 C3.59792988%2c30.5191946 2.14338442%2c30.5191946 1.4161117%2c29.7919219 C0.688838969%2c29.0646492 0.688838969%2c27.6101037 1.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 28.337376) rotate(-270.000000) translate(-2.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c11.882831 C2.14338442%2c11.1555583 3.59792988%2c11.1555583 4.32520261%2c11.882831 C5.05247533%2c12.6101037 5.05247533%2c14.0646492 4.32520261%2c14.7919219 C3.59792988%2c15.5191946 2.14338442%2c15.5191946 1.4161117%2c14.7919219 C0.688838969%2c14.0646492 0.688838969%2c12.6101037 1.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 13.337376) rotate(-270.000000) translate(-2.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c41.882831 C2.14338442%2c41.1555583 3.59792988%2c41.1555583 4.32520261%2c41.882831 C5.05247533%2c42.6101037 5.05247533%2c44.0646492 4.32520261%2c44.7919219 C3.59792988%2c45.5191946 2.14338442%2c45.5191946 1.4161117%2c44.7919219 C0.688838969%2c44.0646492 0.688838969%2c42.6101037 1.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 43.337376) rotate(-270.000000) translate(-2.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M12.7087955%2c52.7616679 L41.7087955%2c52.7616679 L12.7087955%2c52.7616679 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 52.761668) scale(-1%2c 1) translate(-27.208795%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c51.3071224 C27.5219057%2c50.5798497 28.9764511%2c50.5798497 29.7037239%2c51.3071224 C30.4309966%2c52.0343951 30.4309966%2c53.4889406 29.7037239%2c54.2162133 C28.9764511%2c54.943486 27.5219057%2c54.943486 26.794633%2c54.2162133 C26.0673602%2c53.4889406 26.0673602%2c52.0343951 26.794633%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 52.761668) scale(-1%2c 1) translate(-28.249178%2c -52.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c51.3071224 C42.5240228%2c50.5798497 43.9785682%2c50.5798497 44.7058409%2c51.3071224 C45.4331137%2c52.0343951 45.4331137%2c53.4889406 44.7058409%2c54.2162133 C43.9785682%2c54.943486 42.5240228%2c54.943486 41.79675%2c54.2162133 C41.0694773%2c53.4889406 41.0694773%2c52.0343951 41.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 52.761668) scale(-1%2c 1) translate(-43.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c51.3071224 C11.5240228%2c50.5798497 12.9785682%2c50.5798497 13.7058409%2c51.3071224 C14.4331137%2c52.0343951 14.4331137%2c53.4889406 13.7058409%2c54.2162133 C12.9785682%2c54.943486 11.5240228%2c54.943486 10.79675%2c54.2162133 C10.0694773%2c53.4889406 10.0694773%2c52.0343951 10.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 52.761668) scale(-1%2c 1) translate(-12.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c1.30712241 C27.5219057%2c0.579849678 28.9764511%2c0.579849678 29.7037239%2c1.30712241 C30.4309966%2c2.03439513 30.4309966%2c3.48894059 29.7037239%2c4.21621331 C28.9764511%2c4.94348604 27.5219057%2c4.94348604 26.794633%2c4.21621331 C26.0673602%2c3.48894059 26.0673602%2c2.03439513 26.794633%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 2.761668) scale(-1%2c 1) translate(-28.249178%2c -2.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c1.30712241 C42.5240228%2c0.579849678 43.9785682%2c0.579849678 44.7058409%2c1.30712241 C45.4331137%2c2.03439513 45.4331137%2c3.48894059 44.7058409%2c4.21621331 C43.9785682%2c4.94348604 42.5240228%2c4.94348604 41.79675%2c4.21621331 C41.0694773%2c3.48894059 41.0694773%2c2.03439513 41.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 2.761668) scale(-1%2c 1) translate(-43.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c1.30712241 C11.5240228%2c0.579849678 12.9785682%2c0.579849678 13.7058409%2c1.30712241 C14.4331137%2c2.03439513 14.4331137%2c3.48894059 13.7058409%2c4.21621331 C12.9785682%2c4.94348604 11.5240228%2c4.94348604 10.79675%2c4.21621331 C10.0694773%2c3.48894059 10.0694773%2c2.03439513 10.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 2.761668) scale(-1%2c 1) translate(-12.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M26.8573052%2c31.9032203 C26.8573052%2c30.8244029 27.715362%2c29.7537529 29.1641302%2c29.753753 C30.6128985%2c29.753753 31.4952154%2c30.8648768 31.4952154%2c31.9845914' id='Path-185-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(29.176260%2c 30.869172) rotate(-180.000000) translate(-29.176260%2c -30.869172) '%3e%3c/path%3e %3cpath d='M17.7408648%2c25.0760063 C17.7408648%2c25.0760063 17.4799907%2c21.5368219 20.2364086%2c21.5368221 C22.780818%2c21.5368223 22.7319523%2c25.0760063 22.7319523%2c25.0760063' id='Path-71-Copy-2' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cpath d='M35.0054141%2c25.0760063 C35.0054141%2c25.0760063 34.74454%2c21.5368219 37.5009578%2c21.5368221 C40.0453672%2c21.5368223 39.9965015%2c25.0760063 39.9965015%2c25.0760063' id='Path-71-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/svg%3e"`; + +exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: warnings 1`] = `Array []`; + +exports[`"generator" option should work with unspecified value with the default base64 encoding: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"generator" option should work with unspecified value with the default base64 encoding: errors 1`] = `Array []`; + +exports[`"generator" option should work with unspecified value with the default base64 encoding: result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjcuMSAoMjgyMTUpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPm1vY2hpPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+CiAgICAgICAgPHJlY3QgaWQ9InBhdGgtMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjcwIiByeD0iMyI+PC9yZWN0PgogICAgICAgIDxtYXNrIGlkPSJtYXNrLTIiIG1hc2tDb250ZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBtYXNrVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiB4PSIwIiB5PSIwIiB3aWR0aD0iNzAiIGhlaWdodD0iNzAiIGZpbGw9IndoaXRlIj4KICAgICAgICAgICAgPHVzZSB4bGluazpocmVmPSIjcGF0aC0x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bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjE3NjI2MCwgMzAuODY5MTcyKSByb3RhdGUoLTE4MC4wMDAwMDApIHRyYW5zbGF0ZSgtMjkuMTc2MjYwLCAtMzAuODY5MTcyKSAiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE3Ljc0MDg2NDgsMjUuMDc2MDA2MyBDMTcuNzQwODY0OCwyNS4wNzYwMDYzIDE3LjQ3OTk5MDcsMjEuNTM2ODIxOSAyMC4yMzY0MDg2LDIxLjUzNjgyMjEgQzIyLjc4MDgxOCwyMS41MzY4MjIzIDIyLjczMTk1MjMsMjUuMDc2MDA2MyAyMi43MzE5NTIzLDI1LjA3NjAwNjMiIGlkPSJQYXRoLTcxLUNvcHktMiIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTM1LjAwNTQxNDEsMjUuMDc2MDA2MyBDMzUuMDA1NDE0MSwyNS4wNzYwMDYzIDM0Ljc0NDU0LDIxLjUzNjgyMTkgMzcuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; + +exports[`"generator" option should work with unspecified value with the default base64 encoding: warnings 1`] = `Array []`; diff --git a/test/__snapshots__/source-option.test.js.snap b/test/__snapshots__/source-option.test.js.snap deleted file mode 100644 index ce7c0a9..0000000 --- a/test/__snapshots__/source-option.test.js.snap +++ /dev/null @@ -1,86 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`"source" option should work with "Function" right custom source implementation for encoding: assets 1`] = ` -Array [ - "main.bundle.js", -] -`; - -exports[`"source" option should work with "Function" right custom source implementation for encoding: errors 1`] = `Array []`; - -exports[`"source" option should work with "Function" right custom source implementation for encoding: result 1`] = `"data:image/svg+xml, mochi Created with Sketch. "`; - -exports[`"source" option should work with "Function" right custom source implementation for encoding: warnings 1`] = `Array []`; - -exports[`"source" option should work with "Function" that return the encoding manually: assets 1`] = ` -Array [ - "main.bundle.js", -] -`; - -exports[`"source" option should work with "Function" that return the encoding manually: errors 1`] = `Array []`; - -exports[`"source" option should work with "Function" that return the encoding manually: result 1`] = ` -"data:image/svg+xml;utf8, - - - mochi - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" -`; - -exports[`"source" option should work with "Function" that return the encoding manually: warnings 1`] = `Array []`; - -exports[`"source" option should work with unspecified value with the default base64 encoding: assets 1`] = ` -Array [ - "main.bundle.js", -] -`; - -exports[`"source" option should work with unspecified value with the default base64 encoding: errors 1`] = `Array []`; - -exports[`"source" option should work with unspecified value with the default base64 encoding: result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBH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vcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTM1LjAwNTQxNDEsMjUuMDc2MDA2MyBDMzUuMDA1NDE0MSwyNS4wNzYwMDYzIDM0Ljc0NDU0LDIxLjUzNjgyMTkgMzcuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; - -exports[`"source" option should work with unspecified value with the default base64 encoding: warnings 1`] = `Array []`; diff --git a/test/source-option.test.js b/test/generator-option.test.js similarity index 79% rename from test/source-option.test.js rename to test/generator-option.test.js index ecdfc49..a3ea793 100644 --- a/test/source-option.test.js +++ b/test/generator-option.test.js @@ -4,10 +4,11 @@ import { getCompiler, normalizeErrors, readAsset, - customSourceImplementation, } from './helpers'; -describe('"source" option', () => { +const svgToMiniDataURI = require('mini-svg-data-uri'); + +describe('"generator" option', () => { it('should work with unspecified value with the default base64 encoding', async () => { const compiler = getCompiler('simple-svg.js'); const stats = await compile(compiler); @@ -21,9 +22,9 @@ describe('"source" option', () => { ); expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "Function" right custom source implementation for encoding', async () => { + it('should work with "Function" right mini-svg-data-uri encoding', async () => { const compiler = getCompiler('simple-svg.js', { - source: (content) => customSourceImplementation(content), + generator: (content) => svgToMiniDataURI(content.toString()), }); const stats = await compile(compiler); @@ -36,9 +37,9 @@ describe('"source" option', () => { ); expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "Function" that return the encoding manually', async () => { + it('should work with "Function" generating encoding manually', async () => { const compiler = getCompiler('simple-svg.js', { - source: (content) => `data:image/svg+xml;utf8,${content}`, + generator: (content) => `data:image/svg;utf8,${content.toString('utf8')}`, }); const stats = await compile(compiler); diff --git a/test/helpers/customSourceImplementation.js b/test/helpers/customSourceImplementation.js deleted file mode 100644 index 5cb9106..0000000 --- a/test/helpers/customSourceImplementation.js +++ /dev/null @@ -1,9 +0,0 @@ -export default (content) => { - return ( - `data:image/svg+xml,${ - content - .toString() - .trim() - .replace(/\s+/g, ' ')}` - ); -}; diff --git a/test/helpers/index.js b/test/helpers/index.js index f48670c..afe19df 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -3,13 +3,5 @@ import execute from './execute'; import getCompiler from './getCompiler'; import normalizeErrors from './normalizeErrors'; import readAsset from './readAsset'; -import customSourceImplementation from './customSourceImplementation'; -export { - compile, - execute, - getCompiler, - normalizeErrors, - readAsset, - customSourceImplementation, -}; +export { compile, execute, getCompiler, normalizeErrors, readAsset }; From 79a88fe94925480afd52e0a866d09009e372d3da Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 19:52:32 +0200 Subject: [PATCH 09/15] docs: update option name in examples --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 02ad2de..e687a7a 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,7 @@ module.exports = { { loader: 'url-loader', options: { - source: (svgContentBuffer) => { + generator: (svgContentBuffer) => { const svgToMiniDataURI = require('mini-svg-data-uri'); return svgToMiniDataURI(svgContentBuffer.toString()); @@ -280,11 +280,8 @@ module.exports = { { loader: 'url-loader', options: { - source: (svgContentBuffer) => { - return `data:image/svg;utf8,${svgContentBuffer.toString( - 'utf8' - )}`; - }, + generator: (svgContentBuffer) => + `data:image/svg;utf8,${svgContentBuffer.toString('utf8')}`, }, }, ], From f1649c0ae074f357fc77d62789837ef142550bc1 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Mon, 6 Apr 2020 19:58:41 +0200 Subject: [PATCH 10/15] test: writing better descriptions --- test/__snapshots__/generator-option.test.js.snap | 16 ++++++++-------- test/generator-option.test.js | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/__snapshots__/generator-option.test.js.snap b/test/__snapshots__/generator-option.test.js.snap index bbd0bbf..097e786 100644 --- a/test/__snapshots__/generator-option.test.js.snap +++ b/test/__snapshots__/generator-option.test.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`"generator" option should work with "Function" generating encoding manually: assets 1`] = ` +exports[`"generator" option should work with "Function" generating encoded file manually: assets 1`] = ` Array [ "main.bundle.js", ] `; -exports[`"generator" option should work with "Function" generating encoding manually: errors 1`] = `Array []`; +exports[`"generator" option should work with "Function" generating encoded file manually: errors 1`] = `Array []`; -exports[`"generator" option should work with "Function" generating encoding manually: result 1`] = ` +exports[`"generator" option should work with "Function" generating encoded file manually: result 1`] = ` "data:image/svg;utf8, @@ -59,19 +59,19 @@ exports[`"generator" option should work with "Function" generating encoding manu " `; -exports[`"generator" option should work with "Function" generating encoding manually: warnings 1`] = `Array []`; +exports[`"generator" option should work with "Function" generating encoded file manually: warnings 1`] = `Array []`; -exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: assets 1`] = ` +exports[`"generator" option should work with "Function" mini-svg-data-uri generator: assets 1`] = ` Array [ "main.bundle.js", ] `; -exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: errors 1`] = `Array []`; +exports[`"generator" option should work with "Function" mini-svg-data-uri generator: errors 1`] = `Array []`; -exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: result 1`] = `"data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e %3csvg width='75px' height='75px' viewBox='0 0 75 75' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3c!-- Generator: Sketch 3.7.1 (28215) - http://www.bohemiancoding.com/sketch --%3e %3ctitle%3emochi%3c/title%3e %3cdesc%3eCreated with Sketch.%3c/desc%3e %3cdefs%3e %3crect id='path-1' x='0' y='0' width='70' height='70' rx='3'%3e%3c/rect%3e %3cmask id='mask-2' maskContentUnits='userSpaceOnUse' maskUnits='objectBoundingBox' x='0' y='0' width='70' height='70' fill='white'%3e %3cuse xlink:href='%23path-1'%3e%3c/use%3e %3c/mask%3e %3c/defs%3e %3cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e %3cg id='mochi'%3e %3cg id='Group-15' transform='translate(1.000000%2c 1.000000)'%3e %3crect id='Rectangle-68-Copy-7' fill='%23414141' opacity='0.149055504' x='3' y='3' width='70' height='70' rx='3'%3e%3c/rect%3e %3cuse id='Rectangle-68' stroke='%23636363' mask='url(%23mask-2)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' fill='white' xlink:href='%23path-1'%3e%3c/use%3e %3cg id='Group-9' transform='translate(7.000000%2c 8.000000)'%3e %3cpath d='M12.7087955%2c2.76166786 L41.7087955%2c2.76166786 L12.7087955%2c2.76166786 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 2.761668) scale(-1%2c 1) translate(-27.208795%2c -2.761668) '%3e%3c/path%3e %3cg id='Group-7'%3e %3cpath d='M31.3359142%2c55.5629258 C44.9723574%2c55.5629258 56.0268789%2c44.5084044 56.0268789%2c30.8719611 C56.0268789%2c17.2355178 44.9723574%2c6.18099642 31.3359142%2c6.18099642 C17.6994709%2c6.18099642 6.6449495%2c17.2355178 6.6449495%2c30.8719611 C6.6449495%2c44.5084044 17.6994709%2c55.5629258 31.3359142%2c55.5629258 Z' id='Oval-31-Copy-5' fill='%23414141' opacity='0.149055504'%3e%3c/path%3e %3cpath d='M28.3359142%2c52.5629258 C41.9723574%2c52.5629258 53.0268789%2c41.5084044 53.0268789%2c27.8719611 C53.0268789%2c14.2355178 41.9723574%2c3.18099642 28.3359142%2c3.18099642 C14.6994709%2c3.18099642 3.6449495%2c14.2355178 3.6449495%2c27.8719611 C3.6449495%2c41.5084044 14.6994709%2c52.5629258 28.3359142%2c52.5629258 Z' id='Oval-31' stroke='%23636363' stroke-width='2.5' fill='white'%3e%3c/path%3e %3cpath d='M23.0794925%2c7.04758997 C16.7071225%2c8.74491579 11.6454525%2c12.970402 8.98981238%2c18.4999219' id='Path-21' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='40.8211184' cy='28.6625021' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='17.5314022' cy='28.4940298' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cpath d='M39.3706572%2c27 L68.3706572%2c27 L39.3706572%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(53.870657%2c 27.000000) rotate(-270.000000) translate(-53.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M52.4161117%2c26.882831 C53.1433844%2c26.1555583 54.5979299%2c26.1555583 55.3252026%2c26.882831 C56.0524753%2c27.6101037 56.0524753%2c29.0646492 55.3252026%2c29.7919219 C54.5979299%2c30.5191946 53.1433844%2c30.5191946 52.4161117%2c29.7919219 C51.688839%2c29.0646492 51.688839%2c27.6101037 52.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 28.337376) rotate(-270.000000) translate(-53.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c11.882831 C53.1433844%2c11.1555583 54.5979299%2c11.1555583 55.3252026%2c11.882831 C56.0524753%2c12.6101037 56.0524753%2c14.0646492 55.3252026%2c14.7919219 C54.5979299%2c15.5191946 53.1433844%2c15.5191946 52.4161117%2c14.7919219 C51.688839%2c14.0646492 51.688839%2c12.6101037 52.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 13.337376) rotate(-270.000000) translate(-53.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c41.882831 C53.1433844%2c41.1555583 54.5979299%2c41.1555583 55.3252026%2c41.882831 C56.0524753%2c42.6101037 56.0524753%2c44.0646492 55.3252026%2c44.7919219 C54.5979299%2c45.5191946 53.1433844%2c45.5191946 52.4161117%2c44.7919219 C51.688839%2c44.0646492 51.688839%2c42.6101037 52.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 43.337376) rotate(-270.000000) translate(-53.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M-11.6293428%2c27 L17.3706572%2c27 L-11.6293428%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(2.870657%2c 27.000000) rotate(-270.000000) translate(-2.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M1.4161117%2c26.882831 C2.14338442%2c26.1555583 3.59792988%2c26.1555583 4.32520261%2c26.882831 C5.05247533%2c27.6101037 5.05247533%2c29.0646492 4.32520261%2c29.7919219 C3.59792988%2c30.5191946 2.14338442%2c30.5191946 1.4161117%2c29.7919219 C0.688838969%2c29.0646492 0.688838969%2c27.6101037 1.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 28.337376) rotate(-270.000000) translate(-2.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c11.882831 C2.14338442%2c11.1555583 3.59792988%2c11.1555583 4.32520261%2c11.882831 C5.05247533%2c12.6101037 5.05247533%2c14.0646492 4.32520261%2c14.7919219 C3.59792988%2c15.5191946 2.14338442%2c15.5191946 1.4161117%2c14.7919219 C0.688838969%2c14.0646492 0.688838969%2c12.6101037 1.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 13.337376) rotate(-270.000000) translate(-2.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c41.882831 C2.14338442%2c41.1555583 3.59792988%2c41.1555583 4.32520261%2c41.882831 C5.05247533%2c42.6101037 5.05247533%2c44.0646492 4.32520261%2c44.7919219 C3.59792988%2c45.5191946 2.14338442%2c45.5191946 1.4161117%2c44.7919219 C0.688838969%2c44.0646492 0.688838969%2c42.6101037 1.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 43.337376) rotate(-270.000000) translate(-2.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M12.7087955%2c52.7616679 L41.7087955%2c52.7616679 L12.7087955%2c52.7616679 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 52.761668) scale(-1%2c 1) translate(-27.208795%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c51.3071224 C27.5219057%2c50.5798497 28.9764511%2c50.5798497 29.7037239%2c51.3071224 C30.4309966%2c52.0343951 30.4309966%2c53.4889406 29.7037239%2c54.2162133 C28.9764511%2c54.943486 27.5219057%2c54.943486 26.794633%2c54.2162133 C26.0673602%2c53.4889406 26.0673602%2c52.0343951 26.794633%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 52.761668) scale(-1%2c 1) translate(-28.249178%2c -52.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c51.3071224 C42.5240228%2c50.5798497 43.9785682%2c50.5798497 44.7058409%2c51.3071224 C45.4331137%2c52.0343951 45.4331137%2c53.4889406 44.7058409%2c54.2162133 C43.9785682%2c54.943486 42.5240228%2c54.943486 41.79675%2c54.2162133 C41.0694773%2c53.4889406 41.0694773%2c52.0343951 41.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 52.761668) scale(-1%2c 1) translate(-43.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c51.3071224 C11.5240228%2c50.5798497 12.9785682%2c50.5798497 13.7058409%2c51.3071224 C14.4331137%2c52.0343951 14.4331137%2c53.4889406 13.7058409%2c54.2162133 C12.9785682%2c54.943486 11.5240228%2c54.943486 10.79675%2c54.2162133 C10.0694773%2c53.4889406 10.0694773%2c52.0343951 10.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 52.761668) scale(-1%2c 1) translate(-12.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c1.30712241 C27.5219057%2c0.579849678 28.9764511%2c0.579849678 29.7037239%2c1.30712241 C30.4309966%2c2.03439513 30.4309966%2c3.48894059 29.7037239%2c4.21621331 C28.9764511%2c4.94348604 27.5219057%2c4.94348604 26.794633%2c4.21621331 C26.0673602%2c3.48894059 26.0673602%2c2.03439513 26.794633%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 2.761668) scale(-1%2c 1) translate(-28.249178%2c -2.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c1.30712241 C42.5240228%2c0.579849678 43.9785682%2c0.579849678 44.7058409%2c1.30712241 C45.4331137%2c2.03439513 45.4331137%2c3.48894059 44.7058409%2c4.21621331 C43.9785682%2c4.94348604 42.5240228%2c4.94348604 41.79675%2c4.21621331 C41.0694773%2c3.48894059 41.0694773%2c2.03439513 41.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 2.761668) scale(-1%2c 1) translate(-43.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c1.30712241 C11.5240228%2c0.579849678 12.9785682%2c0.579849678 13.7058409%2c1.30712241 C14.4331137%2c2.03439513 14.4331137%2c3.48894059 13.7058409%2c4.21621331 C12.9785682%2c4.94348604 11.5240228%2c4.94348604 10.79675%2c4.21621331 C10.0694773%2c3.48894059 10.0694773%2c2.03439513 10.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 2.761668) scale(-1%2c 1) translate(-12.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M26.8573052%2c31.9032203 C26.8573052%2c30.8244029 27.715362%2c29.7537529 29.1641302%2c29.753753 C30.6128985%2c29.753753 31.4952154%2c30.8648768 31.4952154%2c31.9845914' id='Path-185-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(29.176260%2c 30.869172) rotate(-180.000000) translate(-29.176260%2c -30.869172) '%3e%3c/path%3e %3cpath d='M17.7408648%2c25.0760063 C17.7408648%2c25.0760063 17.4799907%2c21.5368219 20.2364086%2c21.5368221 C22.780818%2c21.5368223 22.7319523%2c25.0760063 22.7319523%2c25.0760063' id='Path-71-Copy-2' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cpath d='M35.0054141%2c25.0760063 C35.0054141%2c25.0760063 34.74454%2c21.5368219 37.5009578%2c21.5368221 C40.0453672%2c21.5368223 39.9965015%2c25.0760063 39.9965015%2c25.0760063' id='Path-71-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/svg%3e"`; +exports[`"generator" option should work with "Function" mini-svg-data-uri generator: result 1`] = `"data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e %3csvg width='75px' height='75px' viewBox='0 0 75 75' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3c!-- Generator: Sketch 3.7.1 (28215) - http://www.bohemiancoding.com/sketch --%3e %3ctitle%3emochi%3c/title%3e %3cdesc%3eCreated with Sketch.%3c/desc%3e %3cdefs%3e %3crect id='path-1' x='0' y='0' width='70' height='70' rx='3'%3e%3c/rect%3e %3cmask id='mask-2' maskContentUnits='userSpaceOnUse' maskUnits='objectBoundingBox' x='0' y='0' width='70' height='70' fill='white'%3e %3cuse xlink:href='%23path-1'%3e%3c/use%3e %3c/mask%3e %3c/defs%3e %3cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e %3cg id='mochi'%3e %3cg id='Group-15' transform='translate(1.000000%2c 1.000000)'%3e %3crect id='Rectangle-68-Copy-7' fill='%23414141' opacity='0.149055504' x='3' y='3' width='70' height='70' rx='3'%3e%3c/rect%3e %3cuse id='Rectangle-68' stroke='%23636363' mask='url(%23mask-2)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' fill='white' xlink:href='%23path-1'%3e%3c/use%3e %3cg id='Group-9' transform='translate(7.000000%2c 8.000000)'%3e %3cpath d='M12.7087955%2c2.76166786 L41.7087955%2c2.76166786 L12.7087955%2c2.76166786 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 2.761668) scale(-1%2c 1) translate(-27.208795%2c -2.761668) '%3e%3c/path%3e %3cg id='Group-7'%3e %3cpath d='M31.3359142%2c55.5629258 C44.9723574%2c55.5629258 56.0268789%2c44.5084044 56.0268789%2c30.8719611 C56.0268789%2c17.2355178 44.9723574%2c6.18099642 31.3359142%2c6.18099642 C17.6994709%2c6.18099642 6.6449495%2c17.2355178 6.6449495%2c30.8719611 C6.6449495%2c44.5084044 17.6994709%2c55.5629258 31.3359142%2c55.5629258 Z' id='Oval-31-Copy-5' fill='%23414141' opacity='0.149055504'%3e%3c/path%3e %3cpath d='M28.3359142%2c52.5629258 C41.9723574%2c52.5629258 53.0268789%2c41.5084044 53.0268789%2c27.8719611 C53.0268789%2c14.2355178 41.9723574%2c3.18099642 28.3359142%2c3.18099642 C14.6994709%2c3.18099642 3.6449495%2c14.2355178 3.6449495%2c27.8719611 C3.6449495%2c41.5084044 14.6994709%2c52.5629258 28.3359142%2c52.5629258 Z' id='Oval-31' stroke='%23636363' stroke-width='2.5' fill='white'%3e%3c/path%3e %3cpath d='M23.0794925%2c7.04758997 C16.7071225%2c8.74491579 11.6454525%2c12.970402 8.98981238%2c18.4999219' id='Path-21' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='40.8211184' cy='28.6625021' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cellipse id='Oval-32' fill='%23F3A5A5' cx='17.5314022' cy='28.4940298' rx='3.57559958' ry='2.31226622'%3e%3c/ellipse%3e %3cpath d='M39.3706572%2c27 L68.3706572%2c27 L39.3706572%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(53.870657%2c 27.000000) rotate(-270.000000) translate(-53.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M52.4161117%2c26.882831 C53.1433844%2c26.1555583 54.5979299%2c26.1555583 55.3252026%2c26.882831 C56.0524753%2c27.6101037 56.0524753%2c29.0646492 55.3252026%2c29.7919219 C54.5979299%2c30.5191946 53.1433844%2c30.5191946 52.4161117%2c29.7919219 C51.688839%2c29.0646492 51.688839%2c27.6101037 52.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 28.337376) rotate(-270.000000) translate(-53.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c11.882831 C53.1433844%2c11.1555583 54.5979299%2c11.1555583 55.3252026%2c11.882831 C56.0524753%2c12.6101037 56.0524753%2c14.0646492 55.3252026%2c14.7919219 C54.5979299%2c15.5191946 53.1433844%2c15.5191946 52.4161117%2c14.7919219 C51.688839%2c14.0646492 51.688839%2c12.6101037 52.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 13.337376) rotate(-270.000000) translate(-53.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M52.4161117%2c41.882831 C53.1433844%2c41.1555583 54.5979299%2c41.1555583 55.3252026%2c41.882831 C56.0524753%2c42.6101037 56.0524753%2c44.0646492 55.3252026%2c44.7919219 C54.5979299%2c45.5191946 53.1433844%2c45.5191946 52.4161117%2c44.7919219 C51.688839%2c44.0646492 51.688839%2c42.6101037 52.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(53.870657%2c 43.337376) rotate(-270.000000) translate(-53.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M-11.6293428%2c27 L17.3706572%2c27 L-11.6293428%2c27 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(2.870657%2c 27.000000) rotate(-270.000000) translate(-2.870657%2c -27.000000) '%3e%3c/path%3e %3cpath d='M1.4161117%2c26.882831 C2.14338442%2c26.1555583 3.59792988%2c26.1555583 4.32520261%2c26.882831 C5.05247533%2c27.6101037 5.05247533%2c29.0646492 4.32520261%2c29.7919219 C3.59792988%2c30.5191946 2.14338442%2c30.5191946 1.4161117%2c29.7919219 C0.688838969%2c29.0646492 0.688838969%2c27.6101037 1.4161117%2c26.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 28.337376) rotate(-270.000000) translate(-2.870657%2c -28.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c11.882831 C2.14338442%2c11.1555583 3.59792988%2c11.1555583 4.32520261%2c11.882831 C5.05247533%2c12.6101037 5.05247533%2c14.0646492 4.32520261%2c14.7919219 C3.59792988%2c15.5191946 2.14338442%2c15.5191946 1.4161117%2c14.7919219 C0.688838969%2c14.0646492 0.688838969%2c12.6101037 1.4161117%2c11.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 13.337376) rotate(-270.000000) translate(-2.870657%2c -13.337376) '%3e%3c/path%3e %3cpath d='M1.4161117%2c41.882831 C2.14338442%2c41.1555583 3.59792988%2c41.1555583 4.32520261%2c41.882831 C5.05247533%2c42.6101037 5.05247533%2c44.0646492 4.32520261%2c44.7919219 C3.59792988%2c45.5191946 2.14338442%2c45.5191946 1.4161117%2c44.7919219 C0.688838969%2c44.0646492 0.688838969%2c42.6101037 1.4161117%2c41.882831 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(2.870657%2c 43.337376) rotate(-270.000000) translate(-2.870657%2c -43.337376) '%3e%3c/path%3e %3cpath d='M12.7087955%2c52.7616679 L41.7087955%2c52.7616679 L12.7087955%2c52.7616679 Z' id='Path-41' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(27.208795%2c 52.761668) scale(-1%2c 1) translate(-27.208795%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c51.3071224 C27.5219057%2c50.5798497 28.9764511%2c50.5798497 29.7037239%2c51.3071224 C30.4309966%2c52.0343951 30.4309966%2c53.4889406 29.7037239%2c54.2162133 C28.9764511%2c54.943486 27.5219057%2c54.943486 26.794633%2c54.2162133 C26.0673602%2c53.4889406 26.0673602%2c52.0343951 26.794633%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 52.761668) scale(-1%2c 1) translate(-28.249178%2c -52.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c51.3071224 C42.5240228%2c50.5798497 43.9785682%2c50.5798497 44.7058409%2c51.3071224 C45.4331137%2c52.0343951 45.4331137%2c53.4889406 44.7058409%2c54.2162133 C43.9785682%2c54.943486 42.5240228%2c54.943486 41.79675%2c54.2162133 C41.0694773%2c53.4889406 41.0694773%2c52.0343951 41.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 52.761668) scale(-1%2c 1) translate(-43.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c51.3071224 C11.5240228%2c50.5798497 12.9785682%2c50.5798497 13.7058409%2c51.3071224 C14.4331137%2c52.0343951 14.4331137%2c53.4889406 13.7058409%2c54.2162133 C12.9785682%2c54.943486 11.5240228%2c54.943486 10.79675%2c54.2162133 C10.0694773%2c53.4889406 10.0694773%2c52.0343951 10.79675%2c51.3071224 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 52.761668) scale(-1%2c 1) translate(-12.251295%2c -52.761668) '%3e%3c/path%3e %3cpath d='M26.794633%2c1.30712241 C27.5219057%2c0.579849678 28.9764511%2c0.579849678 29.7037239%2c1.30712241 C30.4309966%2c2.03439513 30.4309966%2c3.48894059 29.7037239%2c4.21621331 C28.9764511%2c4.94348604 27.5219057%2c4.94348604 26.794633%2c4.21621331 C26.0673602%2c3.48894059 26.0673602%2c2.03439513 26.794633%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(28.249178%2c 2.761668) scale(-1%2c 1) translate(-28.249178%2c -2.761668) '%3e%3c/path%3e %3cpath d='M41.79675%2c1.30712241 C42.5240228%2c0.579849678 43.9785682%2c0.579849678 44.7058409%2c1.30712241 C45.4331137%2c2.03439513 45.4331137%2c3.48894059 44.7058409%2c4.21621331 C43.9785682%2c4.94348604 42.5240228%2c4.94348604 41.79675%2c4.21621331 C41.0694773%2c3.48894059 41.0694773%2c2.03439513 41.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(43.251295%2c 2.761668) scale(-1%2c 1) translate(-43.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M10.79675%2c1.30712241 C11.5240228%2c0.579849678 12.9785682%2c0.579849678 13.7058409%2c1.30712241 C14.4331137%2c2.03439513 14.4331137%2c3.48894059 13.7058409%2c4.21621331 C12.9785682%2c4.94348604 11.5240228%2c4.94348604 10.79675%2c4.21621331 C10.0694773%2c3.48894059 10.0694773%2c2.03439513 10.79675%2c1.30712241 Z' id='Rectangle-30' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' fill='white' transform='translate(12.251295%2c 2.761668) scale(-1%2c 1) translate(-12.251295%2c -2.761668) '%3e%3c/path%3e %3cpath d='M26.8573052%2c31.9032203 C26.8573052%2c30.8244029 27.715362%2c29.7537529 29.1641302%2c29.753753 C30.6128985%2c29.753753 31.4952154%2c30.8648768 31.4952154%2c31.9845914' id='Path-185-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round' transform='translate(29.176260%2c 30.869172) rotate(-180.000000) translate(-29.176260%2c -30.869172) '%3e%3c/path%3e %3cpath d='M17.7408648%2c25.0760063 C17.7408648%2c25.0760063 17.4799907%2c21.5368219 20.2364086%2c21.5368221 C22.780818%2c21.5368223 22.7319523%2c25.0760063 22.7319523%2c25.0760063' id='Path-71-Copy-2' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3cpath d='M35.0054141%2c25.0760063 C35.0054141%2c25.0760063 34.74454%2c21.5368219 37.5009578%2c21.5368221 C40.0453672%2c21.5368223 39.9965015%2c25.0760063 39.9965015%2c25.0760063' id='Path-71-Copy' stroke='%23636363' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/svg%3e"`; -exports[`"generator" option should work with "Function" right mini-svg-data-uri encoding: warnings 1`] = `Array []`; +exports[`"generator" option should work with "Function" mini-svg-data-uri generator: warnings 1`] = `Array []`; exports[`"generator" option should work with unspecified value with the default base64 encoding: assets 1`] = ` Array [ diff --git a/test/generator-option.test.js b/test/generator-option.test.js index a3ea793..d8601ce 100644 --- a/test/generator-option.test.js +++ b/test/generator-option.test.js @@ -22,7 +22,7 @@ describe('"generator" option', () => { ); expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "Function" right mini-svg-data-uri encoding', async () => { + it('should work with "Function" mini-svg-data-uri generator', async () => { const compiler = getCompiler('simple-svg.js', { generator: (content) => svgToMiniDataURI(content.toString()), }); @@ -37,7 +37,7 @@ describe('"generator" option', () => { ); expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "Function" generating encoding manually', async () => { + it('should work with "Function" generating encoded file manually', async () => { const compiler = getCompiler('simple-svg.js', { generator: (content) => `data:image/svg;utf8,${content.toString('utf8')}`, }); From 218b6238c9caf791b343cfe217ebcbba0305fa64 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Tue, 7 Apr 2020 11:55:22 +0200 Subject: [PATCH 11/15] feat: allow boolean type for encoding option --- README.md | 4 +- src/index.js | 10 ++- src/options.json | 6 +- .../encoding-option.test.js.snap | 73 +++++++++++++++++++ test/encoding-option.test.js | 32 ++++++++ 5 files changed, 120 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e687a7a..68b3c89 100644 --- a/README.md +++ b/README.md @@ -209,11 +209,13 @@ module.exports = { ### `encoding` -Type: `String` +Type: `String|Boolean` Default: `base64` Specify the encoding which the file will be in-lined with. It supports [Node.js Buffers and Character Encodings](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings) which are `["utf8","utf16le","latin1","base64","hex","ascii","binary","ucs2"]`. +> If you don't want to use any encoding you can set `encoding` to `false` however if you set it to `true` it will use the default encoding `base64`. + **webpack.config.js** ```js diff --git a/src/index.js b/src/index.js index 2e23e60..22c09b9 100644 --- a/src/index.js +++ b/src/index.js @@ -36,7 +36,11 @@ export default function loader(src) { if (shouldTransform(options.limit, src.length)) { const file = this.resourcePath; const mimetype = options.mimetype || mime.contentType(path.extname(file)); - const encoding = options.encoding || 'base64'; + + const encoding = + options.encoding === true || options.encoding === undefined + ? 'base64' + : options.encoding; if (typeof src === 'string') { // eslint-disable-next-line no-param-reassign @@ -48,7 +52,9 @@ export default function loader(src) { const encodedData = options.generator ? options.generator(src) - : `data:${mimetype || ''};${encoding},${src.toString(encoding)}`; + : `data:${mimetype || ''}${encoding ? `;${encoding}` : ''},${ + encoding ? src.toString(encoding) : src.toString() + }`; return `${ esModule ? 'export default' : 'module.exports =' diff --git a/src/options.json b/src/options.json index 01068ec..5524fde 100644 --- a/src/options.json +++ b/src/options.json @@ -7,7 +7,7 @@ }, "encoding": { "description": "Specify the encoding which the file will be in-lined with.", - "type": "string", + "type": ["boolean", "string"], "enum": [ "utf8", "utf16le", @@ -16,7 +16,9 @@ "hex", "ascii", "binary", - "ucs2" + "ucs2", + true, + false ] }, "generator": { diff --git a/test/__snapshots__/encoding-option.test.js.snap b/test/__snapshots__/encoding-option.test.js.snap index 560cf8d..42d561e 100644 --- a/test/__snapshots__/encoding-option.test.js.snap +++ b/test/__snapshots__/encoding-option.test.js.snap @@ -1,5 +1,78 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`"encoding" option should work with "Boolean" false default: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "Boolean" false default: errors 1`] = `Array []`; + +exports[`"encoding" option should work with "Boolean" false default: result 1`] = ` +"data:image/svg+xml, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"encoding" option should work with "Boolean" false default: warnings 1`] = `Array []`; + +exports[`"encoding" option should work with "Boolean" true default (base64): assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"encoding" option should work with "Boolean" true default (base64): errors 1`] = `Array []`; + +exports[`"encoding" option should work with "Boolean" true default (base64): result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjcuMSAoMjgyMTUpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPm1vY2hpPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+CiAgICAgICAgPHJlY3QgaWQ9InBhdGgtMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjcwIiByeD0iMyI+PC9yZWN0PgogICAgICAgIDxtYXNrIGlkPSJtYXNrLTIiIG1hc2tDb250ZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBtYXNrVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiB4PSIwIiB5PSIwIiB3aWR0aD0iNzAiIGhlaWdodD0iNzAiIGZpbGw9IndoaXRlIj4KICAgICAgICAgICAgPHVzZSB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICA8L21hc2s+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ibW9jaGkiPgogICAgICAgICAgICA8ZyBpZD0iR3J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ZD0iTTE3Ljc0MDg2NDgsMjUuMDc2MDA2MyBDMTcuNzQwODY0OCwyNS4wNzYwMDYzIDE3LjQ3OTk5MDcsMjEuNTM2ODIxOSAyMC4yMzY0MDg2LDIxLjUzNjgyMjEgQzIyLjc4MDgxOCwyMS41MzY4MjIzIDIyLjczMTk1MjMsMjUuMDc2MDA2MyAyMi43MzE5NTIzLDI1LjA3NjAwNjMiIGlkPSJQYXRoLTcxLUNvcHktMiIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTM1LjAwNTQxNDEsMjUuMDc2MDA2MyBDMzUuMDA1NDE0MSwyNS4wNzYwMDYzIDM0Ljc0NDU0LDIxLjUzNjgyMTkgMzcuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; + +exports[`"encoding" option should work with "Boolean" true default (base64): warnings 1`] = `Array []`; + exports[`"encoding" option should work with "String" right encoding value (ascii): assets 1`] = ` Array [ "main.bundle.js", diff --git a/test/encoding-option.test.js b/test/encoding-option.test.js index a21ead7..47fee09 100644 --- a/test/encoding-option.test.js +++ b/test/encoding-option.test.js @@ -21,6 +21,38 @@ describe('"encoding" option', () => { expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); + it('should work with "Boolean" true default (base64)', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: true, + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + + it('should work with "Boolean" false default', async () => { + const compiler = getCompiler('simple-svg.js', { + encoding: false, + }); + const stats = await compile(compiler); + + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + it('should work with "String" right encoding value (utf8)', async () => { const compiler = getCompiler('simple-svg.js', { encoding: 'utf8', From 1522c1c95c99f06338a736e96760ec27b0157bcb Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Tue, 7 Apr 2020 12:00:16 +0200 Subject: [PATCH 12/15] test: improve tests --- .../encoding-option.test.js.snap | 16 ++--- .../generator-option.test.js.snap | 61 +++++++++++++++++++ test/encoding-option.test.js | 4 +- test/generator-option.test.js | 17 ++++++ 4 files changed, 88 insertions(+), 10 deletions(-) diff --git a/test/__snapshots__/encoding-option.test.js.snap b/test/__snapshots__/encoding-option.test.js.snap index 42d561e..ff65ae9 100644 --- a/test/__snapshots__/encoding-option.test.js.snap +++ b/test/__snapshots__/encoding-option.test.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`"encoding" option should work with "Boolean" false default: assets 1`] = ` +exports[`"encoding" option should work with "Boolean" false (no encoding): assets 1`] = ` Array [ "main.bundle.js", ] `; -exports[`"encoding" option should work with "Boolean" false default: errors 1`] = `Array []`; +exports[`"encoding" option should work with "Boolean" false (no encoding): errors 1`] = `Array []`; -exports[`"encoding" option should work with "Boolean" false default: result 1`] = ` +exports[`"encoding" option should work with "Boolean" false (no encoding): result 1`] = ` "data:image/svg+xml, @@ -59,19 +59,19 @@ exports[`"encoding" option should work with "Boolean" false default: result 1`] " `; -exports[`"encoding" option should work with "Boolean" false default: warnings 1`] = `Array []`; +exports[`"encoding" option should work with "Boolean" false (no encoding): warnings 1`] = `Array []`; -exports[`"encoding" option should work with "Boolean" true default (base64): assets 1`] = ` +exports[`"encoding" option should work with "Boolean" true (default base64): assets 1`] = ` Array [ "main.bundle.js", ] `; -exports[`"encoding" option should work with "Boolean" true default (base64): errors 1`] = `Array []`; +exports[`"encoding" option should work with "Boolean" true (default base64): errors 1`] = `Array []`; -exports[`"encoding" option should work with "Boolean" true default (base64): result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjcuMSAoMjgyMTUpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPm1vY2hpPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+CiAgICAgICAgPHJlY3QgaWQ9InBhdGgtMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjcwIiByeD0iMyI+PC9yZWN0PgogICAgICAgIDxtYXNrIGlkPSJtYX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ZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; +exports[`"encoding" option should work with "Boolean" true (default base64): result 1`] = `"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9Ijc1cHgiIGhlaWdodD0iNzVweCIgdmlld0JveD0iMCAwIDc1IDc1IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjcuMSAoMjgyMTUpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPm1vY2hpPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+CiAgICAgICAgPHJlY3QgaWQ9InBhdGgtMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjcwIiByeD0iMyI+PC9yZWN0PgogICAgICAgIDxtYXNrIGlkPSJtYXNrLTIiIG1hc2tDb250ZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBtYXNrVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiB4PSIwIiB5PSIwIiB3aWR0aD0iNzAiIGhlaWdodD0iNzAiIGZpbGw9IndoaXRlIj4KICAgICAgICAgICAgPHVzZSB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICA8L21hc2s+CiAgICA8L2RlZn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Zm9ybT0idHJhbnNsYXRlKDI5LjE3NjI2MCwgMzAuODY5MTcyKSByb3RhdGUoLTE4MC4wMDAwMDApIHRyYW5zbGF0ZSgtMjkuMTc2MjYwLCAtMzAuODY5MTcyKSAiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE3Ljc0MDg2NDgsMjUuMDc2MDA2MyBDMTcuNzQwODY0OCwyNS4wNzYwMDYzIDE3LjQ3OTk5MDcsMjEuNTM2ODIxOSAyMC4yMzY0MDg2LDIxLjUzNjgyMjEgQzIyLjc4MDgxOCwyMS41MzY4MjIzIDIyLjczMTk1MjMsMjUuMDc2MDA2MyAyMi43MzE5NTIzLDI1LjA3NjAwNjMiIGlkPSJQYXRoLTcxLUNvcHktMiIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTM1LjAwNTQxNDEsMjUuMDc2MDA2MyBDMzUuMDA1NDE0MSwyNS4wNzYwMDYzIDM0Ljc0NDU0LDIxLjUzNjgyMTkgMzcuNTAwOTU3OCwyMS41MzY4MjIxIEM0MC4wNDUzNjcyLDIxLjUzNjgyMjMgMzkuOTk2NTAxNSwyNS4wNzYwMDYzIDM5Ljk5NjUwMTUsMjUuMDc2MDA2MyIgaWQ9IlBhdGgtNzEtQ29weSIgc3Ryb2tlPSIjNjM2MzYzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="`; -exports[`"encoding" option should work with "Boolean" true default (base64): warnings 1`] = `Array []`; +exports[`"encoding" option should work with "Boolean" true (default base64): warnings 1`] = `Array []`; exports[`"encoding" option should work with "String" right encoding value (ascii): assets 1`] = ` Array [ diff --git a/test/__snapshots__/generator-option.test.js.snap b/test/__snapshots__/generator-option.test.js.snap index 097e786..da3f496 100644 --- a/test/__snapshots__/generator-option.test.js.snap +++ b/test/__snapshots__/generator-option.test.js.snap @@ -1,5 +1,66 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`"generator" option should work with "Function" generating encoded file manually, encoding & mimetype should not have any effect: assets 1`] = ` +Array [ + "main.bundle.js", +] +`; + +exports[`"generator" option should work with "Function" generating encoded file manually, encoding & mimetype should not have any effect: errors 1`] = `Array []`; + +exports[`"generator" option should work with "Function" generating encoded file manually, encoding & mimetype should not have any effect: result 1`] = ` +"data:image/svg;utf8, + + + mochi + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" +`; + +exports[`"generator" option should work with "Function" generating encoded file manually, encoding & mimetype should not have any effect: warnings 1`] = `Array []`; + exports[`"generator" option should work with "Function" generating encoded file manually: assets 1`] = ` Array [ "main.bundle.js", diff --git a/test/encoding-option.test.js b/test/encoding-option.test.js index 47fee09..55357d6 100644 --- a/test/encoding-option.test.js +++ b/test/encoding-option.test.js @@ -21,7 +21,7 @@ describe('"encoding" option', () => { expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "Boolean" true default (base64)', async () => { + it('should work with "Boolean" true (default base64)', async () => { const compiler = getCompiler('simple-svg.js', { encoding: true, }); @@ -37,7 +37,7 @@ describe('"encoding" option', () => { expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); }); - it('should work with "Boolean" false default', async () => { + it('should work with "Boolean" false (no encoding)', async () => { const compiler = getCompiler('simple-svg.js', { encoding: false, }); diff --git a/test/generator-option.test.js b/test/generator-option.test.js index d8601ce..556d0e9 100644 --- a/test/generator-option.test.js +++ b/test/generator-option.test.js @@ -43,6 +43,23 @@ describe('"generator" option', () => { }); const stats = await compile(compiler); + expect( + execute(readAsset('main.bundle.js', compiler, stats)) + ).toMatchSnapshot('result'); + expect(Object.keys(stats.compilation.assets)).toMatchSnapshot('assets'); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot('errors'); + }); + it('should work with "Function" generating encoded file manually, encoding & mimetype should not have any effect', async () => { + const compiler = getCompiler('simple-svg.js', { + mimetype: 'image/png', + encoding: 'base64', + generator: (content) => `data:image/svg;utf8,${content.toString('utf8')}`, + }); + const stats = await compile(compiler); + expect( execute(readAsset('main.bundle.js', compiler, stats)) ).toMatchSnapshot('result'); From 21f8bf1495c552a5d1fadc32a3c27fab402b524b Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Tue, 7 Apr 2020 12:02:49 +0200 Subject: [PATCH 13/15] docs: specify file in the second example --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 68b3c89..8c97dea 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,8 @@ module.exports = { By using your own implementation, `mimetype` and `encoding` won't have effect on the final output. until you specify them in the output manually for Example: +**webpack.config.js** + ```js module.exports = { module: { From f287bfd1e348a851debbf514ef5b68ebf53ac531 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Tue, 7 Apr 2020 12:09:40 +0200 Subject: [PATCH 14/15] fix: use typeof for comparing with undefined --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 22c09b9..782068e 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,7 @@ export default function loader(src) { const mimetype = options.mimetype || mime.contentType(path.extname(file)); const encoding = - options.encoding === true || options.encoding === undefined + options.encoding === true || typeof options.encoding === 'undefined' ? 'base64' : options.encoding; From 44374dceb4ca686a124d1f4db679b447a0970a27 Mon Sep 17 00:00:00 2001 From: Islam ElHakmi Date: Tue, 7 Apr 2020 12:32:28 +0200 Subject: [PATCH 15/15] fix: define the types of the option using oneOf --- src/options.json | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/options.json b/src/options.json index 5524fde..1a50d75 100644 --- a/src/options.json +++ b/src/options.json @@ -7,18 +7,22 @@ }, "encoding": { "description": "Specify the encoding which the file will be in-lined with.", - "type": ["boolean", "string"], - "enum": [ - "utf8", - "utf16le", - "latin1", - "base64", - "hex", - "ascii", - "binary", - "ucs2", - true, - false + "oneOf": [ + { + "enum": [ + "utf8", + "utf16le", + "latin1", + "base64", + "hex", + "ascii", + "binary", + "ucs2" + ] + }, + { + "type": "boolean" + } ] }, "generator": {