{"_id":"rollup-plugin-transform-tagged-template","_rev":"3-03ec635b555fff432ee1c14821cf64cd","name":"rollup-plugin-transform-tagged-template","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"rollup-plugin-transform-tagged-template","version":"0.0.1","description":"Apply transformations on static contents of tagged template string literals","homepage":"https://github.com/notlmn/rollup-plugin-transform-tagged-template#readme","repository":{"type":"git","url":"git+https://github.com/notlmn/rollup-plugin-transform-tagged-template.git"},"main":"./cjs/index.js","scripts":{"cjs":"ucjs esm cjs","build":"npm run cjs","lint":"xo esm/","test":"npm run lint && npm run build && rollup -c test/rollup.config.js"},"keywords":["rollup","plugin","template string","template literal","tagged template string literal"],"author":{"name":"Laxman Damera"},"license":"MIT","devDependencies":{"rollup":"^2.18.0","ucjs":"^0.1.1","xo":"^0.32.0"},"module":"./esm/index.js","type":"module","exports":{"import":"./esm/index.js","default":"./cjs/index.js"},"dependencies":{"@babel/generator":"^7.10.3","@babel/parser":"^7.10.3","@babel/traverse":"^7.10.3"},"gitHead":"5580ae904ab99a64d5599454c3fbcd13a660e860","bugs":{"url":"https://github.com/notlmn/rollup-plugin-transform-tagged-template/issues"},"_id":"rollup-plugin-transform-tagged-template@0.0.1","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-8/1nbB3SEkZm0RpCa0wrXPns5uVifQeM7BicfheWqY2yqewMqtTs8fBiwoB0se8hB8o4EDW6VKFIDohjzMSEOQ==","shasum":"40f8aafc165a2a07cc632237266d5143090f234c","tarball":"https://registry.npmjs.org/rollup-plugin-transform-tagged-template/-/rollup-plugin-transform-tagged-template-0.0.1.tgz","fileCount":9,"unpackedSize":6849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8c48CRA9TVsSAnZWagAAElcP/iZ9XtJpdGqt3JxOFKws\nuppOR+yQxCYn0UKiWoAaEo3T6t9Spb8vJqvmPCYw6xqafS0yQBJiY0tElxyV\ndctK3VAm667HodTG9jaCem/M9gii4NblVAPeJEmGHetSR4URQZUQWRI6DFof\nHpVtN854ON/HDKJhUTkvf80SEOjN+64CuoMg2uo36YBBSvpvMYcRa3tEYl/y\no9363y+9TelOgekKdHdzyhWbAzUlQbWjc4iFT6tPlbJHaD8uSHgYnssnewvV\nhIIO+7qUpuaQra83X6ZQhFuDGA9y2Xl9MCf7pJDHuLIS5aaHZRNh9taxpfHy\nHtgAOEhe8j/Cd/jiIgs0m7dsUwyCg6neTuZLEXOis4Gmd6PeVdTRk2Qi9dI1\npenmHlKe8KoavJEXMZ4Z1yDS4Y/NEQfE3VnAUw7zzTVNUcmIbBpFFOGNKDDH\nvhVQmrByCP6ram4y7xq7yp7J28BU5zrTkIdLjqO5sfiPMPLanzUeD+NdAMRS\nGQ4s1ZKTDMmT4AVdjw2hlvN5JR8jSrseswhC/AIQ4X3j8zvJW5rzmiBeTpoI\nPjTlUH4KHDzICFlsSJb9GpakGp6IsL0j4H4MgCfwoTuM0XMxz41sFXCjt4hn\n9xn3RUta6B7l4U0bdp+0DNa04ICJCKLWTyt3uHaQBYqRWw3duGB05o/s/Voc\ndxAf\r\n=ihXB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0MGpW1SmuqVCbX2W3hPFmzl7ZYpjirYx0Aivd7h5DfAiEAjbHQXBEqRbeo+WO1GKKDdguFVGdzMG7hRtSVsoiwkbI="}]},"maintainers":[{"name":"lmn","email":"notlmn@outlook.com"}],"_npmUser":{"name":"lmn","email":"notlmn@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-transform-tagged-template_0.0.1_1592905275518_0.7136840445556245"},"_hasShrinkwrap":false},"0.0.2":{"name":"rollup-plugin-transform-tagged-template","version":"0.0.2","description":"Apply transformations on static contents of tagged template string literals","homepage":"https://github.com/notlmn/rollup-plugin-transform-tagged-template#readme","repository":{"type":"git","url":"git+https://github.com/notlmn/rollup-plugin-transform-tagged-template.git"},"main":"./cjs/index.js","scripts":{"cjs":"ucjs esm cjs","build":"npm run cjs","lint":"xo esm/","test":"npm run lint && npm run build && rollup -c test/rollup.config.js"},"keywords":["rollup","plugin","template string","template literal","tagged template string literal"],"author":{"name":"Laxman Damera"},"license":"MIT","devDependencies":{"rollup":"^2.18.0","ucjs":"^0.1.1","xo":"^0.32.0"},"module":"./esm/index.js","type":"module","exports":{"import":"./esm/index.js","default":"./cjs/index.js"},"dependencies":{"@babel/generator":"^7.10.3","@babel/parser":"^7.10.3","@babel/traverse":"^7.10.3"},"gitHead":"d37a227c2adfe5864d9bb3912a30608351bea4c9","bugs":{"url":"https://github.com/notlmn/rollup-plugin-transform-tagged-template/issues"},"_id":"rollup-plugin-transform-tagged-template@0.0.2","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-kau819PSDXOXKGqnFExu2yhaMPkr/dUvo0VygIaVH3xIBij6PmC/EsX+A7lUiFcvCCVAOXQgiVNP3pS6bmU90g==","shasum":"8029ee4b1f43e8fd371a0656a62d4ddfe3e0dbda","tarball":"https://registry.npmjs.org/rollup-plugin-transform-tagged-template/-/rollup-plugin-transform-tagged-template-0.0.2.tgz","fileCount":9,"unpackedSize":7744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/zYUCRA9TVsSAnZWagAAa4MP/1b1xOyDB/VVt+9WNpEn\nskSbaOOgNzHsbjlNopBKGJPjDPXibDjPkEJ9jxgC9eFk0Wr5LjXJUXT9Qp+I\ncJDU4o+kSoETYFILXr/uamV5qt+LUckg7RhpUxZCLMvTUkw9uJVjeCKPHHbZ\nQH6tvz4NGa1mjfU2z+j7U7uQSqX+piEm/HjJrVUYTdIied42CL9yZH0CMns0\n4XLQbFmqg8sdQmxLb/JDkHZRODhZVmyiGBmazJu/H75l5oSzMtbKM6zAfxOV\nWRi3SE12WVzTVyvBYNgiOwhRpvDrvVZK+mzDA3RUmN78TGfVVEEDcOF5p85o\njyrx1f2HAdXeWUmaAsWem8pQL127BiMQcx7GloeiLs+6CCAQGVsJFo8R0o6Z\nduNJacztS2Z2IvLikE7kUjdH1q+A4JTzxKaH6e7NqwHFKhG0RqsamTxULsB8\n+ggUPHeETuD9OztCe7NjIghRaF9D1dRM7eyPGnbEZ4MEdFhDLwNPFkIIr3za\nwCpQAbA+nEsf+iiLHaIxUz2cblbLEPCjpt+LJ5vIaHhoPrQz/sezw8VJSIp+\nLnbxBsw34pK+udtbMSwGhpMmzEO1rwuxgc6td6h1NVopOBsezuHVEnk2NZmV\nQIeHHy9Tp9tsjmhHYFeBTAYLhY7QLe/Dmp56OcFutO9Hf+naJtOys5lQQoKT\nMKjZ\r\n=h9oS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsrIJ0o19frW3zDkWUoBvwjY/Z9FVt9CeQ1/HvQwzSEQIhAN4cQgZGOmG11XrCFrnFG1gdSq7bvP0vpDQi15RIErLK"}]},"maintainers":[{"name":"lmn","email":"notlmn@outlook.com"}],"_npmUser":{"name":"lmn","email":"notlmn@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-transform-tagged-template_0.0.2_1593783828079_0.4166733460276666"},"_hasShrinkwrap":false},"0.0.3":{"name":"rollup-plugin-transform-tagged-template","version":"0.0.3","description":"Apply transformations on static contents of tagged template string literals","homepage":"https://github.com/notlmn/rollup-plugin-transform-tagged-template#readme","repository":{"type":"git","url":"git+https://github.com/notlmn/rollup-plugin-transform-tagged-template.git"},"main":"./cjs/index.js","scripts":{"cjs":"ucjs esm cjs","build":"npm run cjs","lint":"xo esm/","test":"npm run lint && npm run build && rollup -c test/rollup.config.js"},"keywords":["rollup","plugin","template string","template literal","tagged template string literal"],"author":{"name":"Laxman Damera"},"license":"MIT","devDependencies":{"rollup":"^2.18.0","ucjs":"^0.1.1","xo":"^0.32.0"},"module":"./esm/index.js","type":"module","exports":{"import":"./esm/index.js","default":"./cjs/index.js"},"dependencies":{"@babel/generator":"^7.10.3","@babel/parser":"^7.10.3","@babel/traverse":"^7.10.3"},"xo":{"rules":{"no-unused-vars":"off"}},"gitHead":"e7972a1122887ece41e4cd325ad92979767e3cc8","bugs":{"url":"https://github.com/notlmn/rollup-plugin-transform-tagged-template/issues"},"_id":"rollup-plugin-transform-tagged-template@0.0.3","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-IY8JwVTZxwOqQU1B1lqBAfvj0PXgy60pe480mgfs5CCbwytBMQCSrG1eHnD1o8+JCl+5gHdKK5wNXnFngCHxkw==","shasum":"b18df7931dbc43984a1c81ee2edcc266a9f6844e","tarball":"https://registry.npmjs.org/rollup-plugin-transform-tagged-template/-/rollup-plugin-transform-tagged-template-0.0.3.tgz","fileCount":9,"unpackedSize":10047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAB3zCRA9TVsSAnZWagAAPSUP+waGhwd8o3DsNNFJpdG+\nFtE+I8MSnFV1p1BjrNXYyRdFOC1DNZ7xOD1VoHdvMo2JayPH28S8ldRVd+0U\nnnCHQPzbVgDOmIocO9KHQVYdQJjnAsAX8tMu27NUwZKvYtRtFUOhndN3iY83\n2ueseb7WAvO6svnsEk3XrqPSY+8HxVjlhm4S1EbBBYrd1b9A0jCGiaUo7n/i\n6wyHrsf3NXzlLWOhWuZNw4jluESuwrLEaxVo+cA6wofHinlK4ZyxyGUYvDRD\nb7IHVfExuwM2islTEvKgRv2VQSENAg84bGnC2AFbTOcQqMLRIW/TQhteMePH\ns5n3ci0ieBlJv/BkE7G+ms7P1BniesOG3h7mmfKhjwMWH0SYX+Z+6/hiSQV6\nXjgPYCci58mPeMMWjHnGEcIOHMHQ1uV58Nmn8ztXRoup89MmmY/7onXYBrgv\noaly6w7wOmZTkcAeSPD+M11pjLhYQtEAs6htYYAL8Xd98V0rtK2kU+zI1g2d\ncY/CkghBnpettkkFjRDB/hR/imDnUzTIia+kIWfpXPKmbRF+y2n9DmHkFR8h\nnQUZEHTRoG1qOhhKnr4Ssu+CimkEhgc8cT15zMQgR7E2sTr1CJD/mkHJ35bO\ndyIyBVtadCP3EaW+iTAP6vY7M1nslUln6HBdiTsuqYRMCqxaw1H11uNnXAPM\nL05e\r\n=ty92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0sqjAuEcCK3OtY+yz5RZ/dHET115Bx/hx9V6aK9KMsAIhAKjZgKqONP0vwTAx2YUj3XyGwHGsgcDne0WRgntXnX7Y"}]},"maintainers":[{"name":"lmn","email":"notlmn@outlook.com"}],"_npmUser":{"name":"lmn","email":"notlmn@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-transform-tagged-template_0.0.3_1593843186745_0.5364068352757871"},"_hasShrinkwrap":false}},"time":{"created":"2020-06-23T09:41:15.517Z","0.0.1":"2020-06-23T09:41:15.726Z","modified":"2022-05-16T04:41:30.467Z","0.0.2":"2020-07-03T13:43:48.232Z","0.0.3":"2020-07-04T06:13:06.911Z"},"maintainers":[{"name":"lmn","email":"notlmn@outlook.com"}],"description":"Apply transformations on static contents of tagged template string literals","homepage":"https://github.com/notlmn/rollup-plugin-transform-tagged-template#readme","keywords":["rollup","plugin","template string","template literal","tagged template string literal"],"repository":{"type":"git","url":"git+https://github.com/notlmn/rollup-plugin-transform-tagged-template.git"},"author":{"name":"Laxman Damera"},"bugs":{"url":"https://github.com/notlmn/rollup-plugin-transform-tagged-template/issues"},"license":"MIT","readme":"# rollup-plugin-transform-tagged-template\n\n> Apply transformations on contents of [tagged template string literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals), aka. template strings aka. template literals.\n\n[![npm](https://img.shields.io/npm/v/rollup-plugin-transform-tagged-template)](https://www.npmjs.com/package/rollup-plugin-transform-tagged-template)\n\n## Usage\n\n``` js\n// rollup.config.js\nimport transformTaggedTemplate from 'rollup-plugin-transform-tagged-template';\n\nexport default {\n\tinput: 'test.js',\n\tplugins: [\n\t\ttransformTaggedTemplate({\n\t\t\ttagsToProcess: ['css'],\n\t\t\ttransformer(data) {\n\t\t\t\t// Spaces before and after these characters\n\t\t\t\tdata = data.replace(/\\s*([{}()>~+=^$:!;])\\s*/gm, '$1');\n\n\t\t\t\t// Spaces only after these characters\n\t\t\t\tdata = data.replace(/([\",\\[\\]])\\s+/gm, '$1');\n\n\t\t\t\t// You only need one space consequent in CSS\n\t\t\t\tdata = data.replace(/\\s{2,}/gm, ' ');\n\n\t\t\t\treturn data.trim();\n\t\t\t}\n\t\t})\n\t],\n\toutput: {\n\t\tfile: 'build.js'\n\t}\n};\n```\n\n## API\n\n### `tagsToProces: string[]`\n\nRefers to the tag names that are to be processed. In the example above, `css` is the tag that is processed.\n\nExample: `tagsToProcess: ['handleCSS']` would target the following template literal.\n\n``` js\nconst result = handleCSS`\n\t:host {\n\t\tdisplay: block;\n\t}\n`;\n```\n\n### `transformer: (string) => string`\n\nDoes what it says, one-to-one mapping of part of a template string.\n\n> This could sometimes be only part of what you are expecting to get as argument. See example below.\n\nExample:\n\n``` js\n// code.js\nconst declaration = handleCSS`color: #212121;`;\nconst result = handleCSS`\n\t:host {\n\t\tdisplay: block;\n\t\t${declaration}\n\t}\n`;\n```\n\n``` js\n// rollup.js\n\t// ...\n\tplugins: [\n\t\ttransformTaggedTemplate({\n\t\t\ttagsToProcess: ['handleCSS'],\n\t\t\ttransformer(data) {\n                console.log(data);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t})\n\t],\n\t// ...\n\n// Output\n[\n\t'color: #212121;',\n\t'\\n\\t:host {\\n\\t\\tdisplay: block;\\n\\t\\t',\n\t'\\n\\t\\t}\\n',\n]\n```\n\n### `parserOptions: object`\n\nConfig options to pass to the Babel parser.\n\n> Babel Parser options may be needed depending on how your project is structured. See [Babel parser options](https://babeljs.io/docs/en/babel-parser#options) for all available options.\n\nExample:\n\n```js\n// rollup.js\n\t// ...\n\tplugins: [\n\t\ttransformTaggedTemplate({\n\t\t\tparserOptions: {\n\t\t\t\tsourceType: \"module\", // treat files as ES6 modules\n\t\t\t\tplugins: [\n\t\t\t\t\t\"typescript\", // parse the file as TypeScript\n\t\t\t\t\t[\n\t\t\t\t\t\t\"decorators\", // use decorators proposal plugin\n\t\t\t\t\t\t{ decoratorsBeforeExport: true }\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t}\n\t\t})\n\t],\n\t// ...\n```\n\n## Related\n\n- [rollup-plugin-minify-tagged-css-template](https://github.com/notlmn/rollup-plugin-minify-tagged-css-template) - Rollup plugin to minify CSS content of tagged template string literals.\n\n## License\n\n[MIT](license) &copy; Laxman Damera\n","readmeFilename":"readme.md"}