{"_id":"@aibex/razzle-config-transform","_rev":"4-151f1278062dfc43a598fd83896a77e4","name":"@aibex/razzle-config-transform","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@aibex/razzle-config-transform","version":"0.1.0","description":"Simple transformation engine for razzle.config.js","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["razzle","react","hmr","webpack"],"author":{"name":"Jakob Heuser","email":"jakob+razzle-config-transform@aibex-corp.com"},"license":"Apache-2.0","licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"dependencies":{"json-query":"^2.2.2"},"gitHead":"ac99ed908dbaf186e1f208082c256c9f05bdfac7","_id":"@aibex/razzle-config-transform@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"jakobo","email":"jakob+npm@felocity.com"},"dist":{"integrity":"sha512-P4SnC2Pw0JkoS3y5l1sJSKdEWbgTxEqVUMyYWn3fiu02SFBjIeCr2fO4AM+Gy5nn7XelJJC54UAZF6yr9uj52Q==","shasum":"5211ef8379f30a9ffc104d065daaa576754cdf54","tarball":"https://registry.npmjs.org/@aibex/razzle-config-transform/-/razzle-config-transform-0.1.0.tgz","fileCount":4,"unpackedSize":14984,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3fhuCRA9TVsSAnZWagAAqMkP/ipgCqfM615R/vw8Ey5U\nLsLcsS+LUaA/R4/u3N5MFQ/dU2vMGtPBD69SNyXOWRbGgRe/m9LHICJ7ymDH\n0MzWfmdwFG2klCMi4V3EGoogPgRApGFwDR2/Oq+DJDLYqmcf/Rvj3VyGCOC/\ndUqsJcVEewnm31PvY33nkiLrWaSwNF2KYJnQ3EGjwDuXO61N0+rDE8Z/Qrvf\nwL2byNQGE5aSDR1zHgtad6zm0LEa5ezVG5jKSro+jWzbwV5YAd0xunhypPSg\ntaKDULUb7BuSZkViTnNNJlekaxZgYS6HZ3MpSwvYfk//F8cSs7j7B5f7OhMc\nb2MtLjeyHk5O2/tGoykCziM9Qv9D+HW9Xqr9xXsNrXo1Msct9hx/f85Hibi7\nSrpxmRTsvG7Az6QlIevdwPqUmq0qt5KnHgZlNBNCMWQvr/LRd53tru4z4Ud0\nbenm24LzLvPOGQuFfCuCCHtBkDJe/AJfADXHf+H2ttvY73o9Ib6YB27SgRsB\nuIQ2SpiEHJvXIwZiaR2l/l4v/NYC5/8MSIZpdVF/cssNVC7JlFqW30SIZRqk\n7OGvPC8clzoTGB3NFRapjDuGPTgMNJgyNtCCW4SsgqfzLlo3gbdmum8B4JC9\nkGu4cMzpkt2yl4j/veHOvBQgfvwBZZv/RiBso7tTdwxn4F/UGPxmo4ZhRHG2\nXTaX\r\n=muU5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfUKOp9Aai0/qhkV54t2F5R8d26j7l1hf9bcwK37d5UgIgZcb4eByIabttyowSxLmyufh65304tkMFrB/0yIAp+qA="}]},"maintainers":[{"name":"aibex-main","email":"jakob@aibex-corp.com"},{"name":"jakobo","email":"jakob+npm@felocity.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/razzle-config-transform_0.1.0_1541273709657_0.816969927832945"},"_hasShrinkwrap":false},"0.1.1":{"name":"@aibex/razzle-config-transform","version":"0.1.1","description":"Simple transformation engine for razzle.config.js","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["razzle","react","hmr","webpack"],"author":{"name":"Jakob Heuser","email":"jakob+razzle-config-transform@aibex-corp.com"},"license":"Apache-2.0","licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"dependencies":{"json-query":"^2.2.2"},"gitHead":"2dce33d64fea662e4f2309d6580a41d7bf8de60a","_id":"@aibex/razzle-config-transform@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"jakobo","email":"jakob+npm@felocity.com"},"dist":{"integrity":"sha512-9kRnPvOzSFc4m5UERcnQHjNblU0Fo9wJRLVidlIBhxtSt33oTPi+FMMreEbMpBwXtIcPWgWh0ksMZvs1LoAC7g==","shasum":"3cbf1eac7e3c4c31f05acb3469caa5dcf772aee0","tarball":"https://registry.npmjs.org/@aibex/razzle-config-transform/-/razzle-config-transform-0.1.1.tgz","fileCount":4,"unpackedSize":14981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3foCCRA9TVsSAnZWagAAg6sP/iqSgKJ0wZTFcMbjwwbb\n90C9JtruBhhazC2jy1fDDUDbW+lJz7Z5l+9GAN9WHQaWHmDkIuSfopSvzNdc\nUAUG63fwvLGtNcm31Ryhjhk2peYzyjKNOi7chxCmDTK8iPL5zWyb42VmW26a\nhT9GJFxceGBZ90MXGPxTs69BP57Pi97FEBvc7PGBDYGNSrbsE0a7dw1d2YeA\nO4EWbHOg6SeY0hnAx0jAATSHYcvdIGebVHTnsgt6EfhUvtjlP5VitGsvo4yk\nBYfqeA2/jrvndUGcVlQbDlBcATyLdcx8VzbmXSk6Q8g023beUqxsxKRJHIbt\nZG9vYRdyFzBbjCf7/zVIrRKq0j22lpzv/5QENKlKjAxHUhdhpmGpYIHveZY8\nOObGT62STzV2s9M+Kwqqma40JvcFSUaanj/IV9TZ/1NJJ03Yf+vjCRSnPnzb\nnjb88fMEY62mV3M02l4BNRxcz1V5BIMtV9EAmHOfPRx97oQD5UhN9sZwqs5n\nrQ5od4tYm67pNNFqFRc/4WYPYGP34r9/Y3LxMkPETJcTIlVJQOwwu7qnWcWP\nqFxA2/rKYpfpc74do4ehrPOjeC6Byh/SediZ6QjInij731W3o8/xjVejnUwp\nJADxEF5US4YvCqMrX5+P2d5MgeAwemoewzehNgB2W7NK+HnwNT5mt+jwmjlF\nGLKE\r\n=5SLQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCsA57kGyDfa9/8zBGgD7dcu01qCw9J8KByferVPTeMAiEAqMCASWZWX0ljWu1yWGdzNbcu4FfZaJ6zYnjC5CXPTx8="}]},"maintainers":[{"name":"aibex-main","email":"jakob@aibex-corp.com"},{"name":"jakobo","email":"jakob+npm@felocity.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/razzle-config-transform_0.1.1_1541274113848_0.21280689804900121"},"_hasShrinkwrap":false,"deprecated":"With razzle version 3 launched, it's recommended to use razzle-dev-utils"}},"time":{"created":"2018-11-03T19:35:09.488Z","0.1.0":"2018-11-03T19:35:09.793Z","modified":"2022-04-04T12:15:22.769Z","0.1.1":"2018-11-03T19:41:53.960Z"},"maintainers":[{"email":"jakob+npm@felocity.com","name":"jakobo"}],"description":"Simple transformation engine for razzle.config.js","keywords":["razzle","react","hmr","webpack"],"author":{"name":"Jakob Heuser","email":"jakob+razzle-config-transform@aibex-corp.com"},"license":"Apache-2.0","readme":"# razzle-config-transform\n## Helper utility for deeply nested webpack configurations\n\n[Razzle](https://github.com/jaredpalmer/razzle) is awesome. And if you've used razzle at all, you've also discovered a need to create a `razzle.config.js` file in order to tune your webpack \"just right\" without having to eject.\n\n`razzle-config-transform` is what you should reach for when you have more complex webpack transformations, but aren't ready to write your own transformation functions.\n\nIt works using the excellent [json-query](https://www.npmjs.com/package/json-query) library.\n\n# Example\nThis example adds the [inline-react-svg](https://github.com/airbnb/babel-plugin-inline-react-svg) module to your babel config. Since it is a babel plugin, we query for the `babel-loader` instance, and then operate on any found references of the babel loader.\n\n```js\nvar transform = require('@aibex/razzle-config-transform');\nmodule.exports = {\n  modify: (config, { target, dev }, webpack) => {\n    transform(config, 'module.rules.use[loader~/babel-loader/]', (ref) => {\n      ref.options.plugins.push(['inline-react-svg', {\n        svgo: {\n          plugins: [\n            { removeAttrs: { attrs: '(data-name)' }},\n            { cleanupIDs: true }\n          ]\n        }\n      }]);\n    });\n\n    return config;\n  });\n};\n```\n\n# API\n## `transform(config, path, onEachReference)`\n**config** A webpack configuration object, provided from razzle\n\n**path** A `json-query` friendly path. [See the full json-query docs](https://www.npmjs.com/package/json-query) for additional options. All queries run with the regex option enabled, as we must often look for fully-resolved loaders in the razzle version of a webpack config.\n\nThe most common path used in razzle is `module.rules.use[loader~/YOUR-LOADER/]`, performing a regex match on all loader nodes, finding the one that matches your regex pattern, and then returning the entire `use: {}` collection as a reference. If multiple instances of a path are found, **onEachReference** is called once per match.\n\n**onEachReference** `function(ref) {...}` A function called for every matching reference. In order to avoid complex merge issues, you simply alter the reference directly. `razzle-config-transform` does not attempt to re-merge final objects, that is the responsibility of the developer.\n\n# About\nThis was actually created so that razzle 2 could support babel 7, by extracting the [babel 7 part](https://github.com/jaredpalmer/razzle/blob/e89853267639d62d7930f6ad0e283a5049ccbd35/packages/babel-preset-razzle/index.js) of `razzle@next` and making it something that could be applied in `razzle.config.js`.\n","readmeFilename":"README.md"}