{"_id":"@avensia-oss/ts-transform-export-const-folding","_rev":"7-bef05ffd95814e6b0fe1f5c50287c3fa","name":"@avensia-oss/ts-transform-export-const-folding","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@avensia-oss/ts-transform-export-const-folding","version":"0.0.1","keywords":["TypeScript","transform","transformer","constant","folding"],"author":{"name":"Anders Ekdahl","email":"anders.ekdahl@avensia.com"},"license":"MIT","_id":"@avensia-oss/ts-transform-export-const-folding@0.0.1","maintainers":[{"name":"avensia-oss","email":"andekd@avensia.com"}],"homepage":"https://github.com/avensia-oss/ts-transform-export-const-folding","bugs":{"url":"https://github.com/avensia-oss/ts-transform-export-const-folding/issues"},"dist":{"shasum":"f86dd9231925deb246e3d8b9f8a32b2c10ac7f2f","tarball":"https://registry.npmjs.org/@avensia-oss/ts-transform-export-const-folding/-/ts-transform-export-const-folding-0.0.1.tgz","fileCount":14,"integrity":"sha512-8YqgyLzApQAdt1dsx37i7V0XC+xDTMqNTasiJt2wutRynCQgHaI2H8bYTtrxknzMuIGekXKqfynwRF4N579QAQ==","signatures":[{"sig":"MEQCIGFS+5Kggw8XsvuExqUmimYMjLGspMwVw18aa/N3CmTHAiB5fSuK7izeq4ykJR+yjJl3waVGmtl4o0idUZhcMivMvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJfpyCRA9TVsSAnZWagAAryEP/RaWHjjeEgeUGv3nJimi\nKKy0fIuEK9OUeXQfm752sVpsWPeRs0Wdyx5xsSJ6KkRIY3txFCKtutUfWal9\nKxMpx3ttrA407D10f0+KvgRQ3MgiTir6lrv6wqJXeBivIEPnhj9IpdzPW5SL\niZ9JsTzjnoZAZLM/0rg37KG44mESH6KvNfj0mgP77ws84lehfwkzow6ZdT6G\nACWxvW3gY046sLRyXrvyOj7BKYHfnU5g4ZyxBofBjTNaEuCuH+ExdcD7lpmJ\nhnor5vCDqgxNVFCmMCJPW8m9+X8xSSJrZvO5vV6jeLP1BxLMXv9mFjyk0m5N\npbVfaaJwci9AUwrEorXf/WaHKDVAMrYd+oZo6z99es1gLHHXLUT4O9rePJzV\nN17Zj+xmmdLQVJmBm1GS004fAOY7IiMmn1YpR8SeVbrephtraC3bOsZKHG4b\ndDvMy1eRWQlAcGDq2j29g8lG3hSIOKMjXNbGtiNfZojXp9KxOHIh9Famhbke\nzZMWJqudIrV7Q0YCBFXB7JIHnzQJR0Iol1tv0sNyRDvEeGyIjURhDGH0aT4/\nyvvpBdhKog3USgDTsf4aL69Ja6+8Fyfs5Cj8FbFJ1c4M1qpJLcfcKOFspfl3\n6Q8hjeY6z+rVy9yOe6yaTi4OWAe+IO4GlLHpBe4HeEv3/GEu/v61f19SdhKJ\nNHsb\r\n=vq5o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","private":false,"scripts":{"test":"jest","build":"tsc --version && tsc --project \"./\""},"_npmUser":{"name":"avensia-oss","email":"andekd@avensia.com"},"description":"A TypeScript custom transformer that inlines values of constants","directories":{},"licenseText":"MIT License\n\nCopyright (c) Avensia AB and its affiliates.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","ts-jest":"^23.10.5","prettier":"^1.15.3","typescript":"^3.2.2","@types/jest":"^23.3.10","@types/node":"^10.12.18"},"peerDependencies":{"typescript":"*"},"_npmOperationalInternal":{"tmp":"tmp/ts-transform-export-const-folding_0.0.1_1545992817677_0.9493876719888668","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@avensia-oss/ts-transform-export-const-folding","version":"0.0.2","keywords":["TypeScript","transform","transformer","constant","folding"],"author":{"name":"Anders Ekdahl","email":"anders.ekdahl@avensia.com"},"license":"MIT","_id":"@avensia-oss/ts-transform-export-const-folding@0.0.2","maintainers":[{"name":"avensia-oss","email":"andekd@avensia.com"}],"homepage":"https://github.com/avensia-oss/ts-transform-export-const-folding","bugs":{"url":"https://github.com/avensia-oss/ts-transform-export-const-folding/issues"},"dist":{"shasum":"a131ab3debaa602add56d6e0ea266a81b6764d0b","tarball":"https://registry.npmjs.org/@avensia-oss/ts-transform-export-const-folding/-/ts-transform-export-const-folding-0.0.2.tgz","fileCount":9,"integrity":"sha512-1QbvE9HKMZ1+XMZ8Sf4nqjzrCpOWVwOqKFKQYuzjxs4uFiCAwjVpEIV7vhgFWMV4lvBg7v417d8gKlPU8Ojmmg==","signatures":[{"sig":"MEQCIA3uiss4eIslX8LPL2meQ2iEO/RAjY01i2iw+O8co8SqAiAxjxAMKYfzWmTsEZDTQ34IiTh56xz3c1pJrW9mLWAA+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17360,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJgEYCRA9TVsSAnZWagAApg8P/jpMf/Ea1LgZc3XnVkj+\nzjE95Olv0qm3wRC25chchDjYZ7vZfPpGbFtK2BI+EvYJGoz71X/ErdV9DtrC\nFepBukaS7bUXbfTaPbQVLCefXc7ntdbNSOS68xdWjJsHWuglNgJVVUaddIb/\nLC0aL7Ga94RV+//sgSRXz58fvBQocWZwdARS14JvzkojKLJNA6uxTYgQ21up\nQN2tmSLS2rhtEcsMWBDbSW3XFHnxB33ELB0m6UBMJJZ61lhTZ2l2BL/dEO4w\nxDLu3cA9A/WU63aHZiXLgBJ3RbHRITYISNQrCbpmtnsDvWm7QH3WcCiqh1E6\nYIGQWSsdUSUDgWIZRu5cjFKfb3m7eKKIPTYNdyOgORv7H0IPeKKFTdS8q8tZ\nBiXSIIbv8+Q0u7hUNnXSNdpmZ8yUwvek90cVaJobHsKZGDqNuvH0Fj754Nzz\nu6G2MmS6DBfJ2r3czJWOp/6BBxZhKlGiVRpT26r9N08GNqcO675PrTx4WA5r\n4GW86m6wMy77SVff/gR2ZzVhgMJUoL0NgYug6CdudGhhBRmYw4J0RZ73eMjK\nnc72Z8Ep9fnJ8VVNDRpoiYNXNUJ6T2H3XHJz1Rcz30qynsv0xLm/k5pwCdDe\nQ1dawp24FiSaiiwIZde42MywxyP17mW/7fgXpqBKi+wKPY7OaknH/U+QYzhi\nEcth\r\n=PflL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","private":false,"scripts":{"test":"jest","build":"tsc --version && tsc --project \"./\""},"_npmUser":{"name":"avensia-oss","email":"andekd@avensia.com"},"description":"A TypeScript custom transformer that inlines values of constants","directories":{},"licenseText":"MIT License\n\nCopyright (c) Avensia AB and its affiliates.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","ts-jest":"^23.10.5","prettier":"^1.15.3","typescript":"^3.2.2","@types/jest":"^23.3.10","@types/node":"^10.12.18"},"peerDependencies":{"typescript":"*"},"_npmOperationalInternal":{"tmp":"tmp/ts-transform-export-const-folding_0.0.2_1545994519725_0.46200930412410623","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@avensia-oss/ts-transform-export-const-folding","version":"0.0.3","keywords":["TypeScript","transform","transformer","constant","folding"],"author":{"name":"Anders Ekdahl","email":"anders.ekdahl@avensia.com"},"license":"MIT","_id":"@avensia-oss/ts-transform-export-const-folding@0.0.3","maintainers":[{"name":"avensia-oss","email":"andekd@avensia.com"}],"homepage":"https://github.com/avensia-oss/ts-transform-export-const-folding","bugs":{"url":"https://github.com/avensia-oss/ts-transform-export-const-folding/issues"},"dist":{"shasum":"64cd541e57fdc95f354786e3a8c3ee81c02f0442","tarball":"https://registry.npmjs.org/@avensia-oss/ts-transform-export-const-folding/-/ts-transform-export-const-folding-0.0.3.tgz","fileCount":9,"integrity":"sha512-e4NgxkVUfOwbTXi1CzDV9FHogwJ0FSj93Soa2rVwRDhcqaPNxtP+IoKw2lxVPbJLswjb2N3XLwWwF08e9tjcpw==","signatures":[{"sig":"MEYCIQDoMzWzgilaiueul0SpW8YD7h9pVZNIMfTE8X/oVaRHSQIhALMODwuh+qrBtrOZgoJmfr4mR0DiUshkssqHY/3LCR9H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJgJHCRA9TVsSAnZWagAAzIAP/2X+AXMThPcmnnHm8TA4\n5DsH9m5ZATL5wyjPO/Y7OhoD4qkWxO+2TjBMhSdWPwDEQiOUSpJ83zvT7Ba0\n6wpJbl7ZWgqjVijJVltoiPP9MKlN8sf2WtlrK1m3tKYGRVc8LYRJfC7vgR3Z\nQgS5kArRuJrzFqTMhZUrF5tVXe39cXriydVCqvnYInC4+WvjtAxVZ3q+p0FC\nbkkH+wcxO49R5SuQuecQwBl7KrCMzPsRJy5VB71SO1SW18/gk2w6+sU0F/+H\n0Ff+oMVqxaEBefvPTfX0qknM3tkJDgWq9xr1ipnS+ytIfcBEORpfz/oxczNW\nhQh9z8iZA+EmUpFaOwy1QvlSA347voGKAfsx4kYYD0KnF9TbTOeZAEsToZ4C\nrFNdhIL89PZxQy+8zKcUx9AL7+A/PWjSC4t99lDgA3QQNXYEYnD4u/pNR17F\ngZ1OEK/JvUN1uUC05ry8oHjhSz3cVbylAiWMIOyuFCTzweL0jk9B8baLn8lC\n5ClchDxuX2AXrDNfz1MXzQrqO78+RbcndzAWp1jI+FxNWGXrNFdJZraviCMZ\n5t95PoK339STuvLAqh888BP6riKnlnWf5NsWKe5ALs5E3GIO3SXVT4P5JkS7\nADSlocQaAh371dBiFWIZy6JAHiWlU51LmjJAFrl4Ne03knOwrp0x9K5KJMve\nwPl3\r\n=QD04\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","private":false,"scripts":{"test":"jest","build":"tsc --version && tsc --project \"./\""},"_npmUser":{"name":"avensia-oss","email":"andekd@avensia.com"},"description":"A TypeScript custom transformer that inlines values of constants","directories":{},"licenseText":"MIT License\n\nCopyright (c) Avensia AB and its affiliates.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","ts-jest":"^23.10.5","prettier":"^1.15.3","typescript":"^3.2.2","@types/jest":"^23.3.10","@types/node":"^10.12.18"},"peerDependencies":{"typescript":"*"},"_npmOperationalInternal":{"tmp":"tmp/ts-transform-export-const-folding_0.0.3_1545994822715_0.8570492157752498","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-12-28T10:26:57.504Z","modified":"2026-09-21T11:35:03.996Z","0.0.1":"2018-12-28T10:26:57.817Z","0.0.2":"2018-12-28T10:55:19.868Z","0.0.3":"2018-12-28T11:00:22.845Z"},"bugs":{"url":"https://github.com/avensia-oss/ts-transform-export-const-folding/issues"},"author":{"name":"Anders Ekdahl","email":"anders.ekdahl@avensia.com"},"license":"MIT","homepage":"https://github.com/avensia-oss/ts-transform-export-const-folding","keywords":["TypeScript","transform","transformer","constant","folding"],"description":"A TypeScript custom transformer that inlines values of constants","maintainers":[{"email":"eric.lindell@avensia.com","name":"lindelleric"},{"email":"johan.book@avensia.com","name":"johboo"},{"email":"johan.nilsson@avensia.com","name":"yoohahn-avensia"}],"readme":"# ts-transform-export-const-folding\n\nA rather long name, but a descriptive one (hopefully) at least. This is a TypeScript custom transform that removes imported constants by inlining them. An example would be:\n\n```\n// file1.ts\nexport const x = 'xxx';\n\n// file2.ts\nimport { x } from './file1';\nlet y = x;\n```\n\nWith this transform the above gets transformed into:\n\n```\n// file1.ts\nexport const x = 'xxx';\n\n// file2.ts\nconst x = 'xxx';\nlet y = x;\n```\n\nWhat's the point of doing that? It removes the dependency between these modules, which means that they don't have to be bundled together.\n\n# Installation\n\n```\nyarn add @avensia-oss/ts-transform-export-const-folding\n```\n\n## Usage with webpack\n\nUnfortunately TypeScript doesn't let you specifiy custom transformers in `tsconfig.json`. If you're using `ts-loader` with webpack you can specify it like this:\nhttps://github.com/TypeStrong/ts-loader#getcustomtransformers-----before-transformerfactory-after-transformerfactory--\n\nThe default export of this module is a function which expects a `ts.Program` an returns a transformer function. Your config should look something like this:\n\n```\nconst exportConstFoldingTransform = require('@avensia-oss/ts-transform-export-const-folding');\n\nreturn {\n  ...\n  options: {\n    getCustomTransformers: (program) => ({\n      before: [exportConstFoldingTransform(program)]\n    })\n  }\n  ...\n};\n```\n","readmeFilename":"README.md"}