{"_id":"@anchanix/unplugin-fluent","_rev":"2-a3ce45c86b992eb3c4ae293285cf88fa","name":"@anchanix/unplugin-fluent","dist-tags":{"latest":"0.1.0-beta.3"},"versions":{"0.1.0-beta.1":{"name":"@anchanix/unplugin-fluent","version":"0.1.0-beta.1","keywords":["unplugin","vite","webpack","rollup","transform"],"license":"MIT","_id":"@anchanix/unplugin-fluent@0.1.0-beta.1","maintainers":[{"name":"anchanix","email":"sam@anchanix.me"}],"homepage":"https://github.com/smc13/unplugin-fluent#readme","bugs":{"url":"https://github.com/smc13/unplugin-fluent/issues"},"dist":{"shasum":"94f51569ae3de38fbf25acc88905c4e75a4ca932","tarball":"https://registry.npmjs.org/@anchanix/unplugin-fluent/-/unplugin-fluent-0.1.0-beta.1.tgz","fileCount":49,"integrity":"sha512-gv+3KUEZcp9NU8KZlioN50xrF0zj+lyX+KHslHG6WmSK7uSVMxacEd9tw60pjZYVeKm4MaXgrD6lmt7GKGjNeg==","signatures":[{"sig":"MEQCIFtDW/Suhe0i09k3gLAW1FVev+RYU2FC08/Ln7pLi+xpAiBoB3z67I8/LSj7OUIQh+gPWurKL5+9gPuNRnuMqFVhLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":208900},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":"./*","./farm":{"import":"./dist/farm.js","require":"./dist/farm.cjs"},"./nuxt":{"import":"./dist/nuxt.js","require":"./dist/nuxt.cjs"},"./vite":{"import":"./dist/vite.js","require":"./dist/vite.cjs"},"./astro":{"import":"./dist/astro.js","require":"./dist/astro.cjs"},"./types":{"import":"./dist/types.js","require":"./dist/types.cjs"},"./rollup":{"import":"./dist/rollup.js","require":"./dist/rollup.cjs"},"./rspack":{"import":"./dist/rspack.js","require":"./dist/rspack.cjs"},"./esbuild":{"import":"./dist/esbuild.js","require":"./dist/esbuild.cjs"},"./webpack":{"import":"./dist/webpack.js","require":"./dist/webpack.cjs"}},"gitHead":"7415425354290e27d557b33a7eb8ecfa10168ecb","scripts":{"dev":"tsup --watch src","lint":"eslint .","play":"npm -C playground run dev","test":"vitest","build":"tsup","start":"esno src/index.ts","release":"bumpp && npm publish","build:fix":"esno scripts/postbuild.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"anchanix","email":"sam@anchanix.me"},"repository":{"url":"git+https://github.com/smc13/unplugin-fluent.git","type":"git"},"_npmVersion":"10.2.3","description":"Plugin for Vite and other bundlers to easily import [project fluent](https://projectfluent.org/) bundles.","directories":{},"_nodeVersion":"21.2.0","dependencies":{"unplugin":"^1.12.2","@fluent/bundle":"^0.18.0","@anchanix/fluent-utils":"^0.1.0-beta.0"},"typesVersions":{"*":{"*":["./dist/*","./*"]}},"_hasShrinkwrap":false,"packageManager":"pnpm@9.9.0","devDependencies":{"esno":"^4.7.0","tsup":"^8.2.4","vite":"^5.4.2","bumpp":"^9.5.2","chalk":"^5.3.0","eslint":"^9.9.1","rollup":"^4.21.2","vitest":"^2.0.5","nodemon":"^3.1.4","webpack":"^5.94.0","@nuxt/kit":"^3.13.0","fast-glob":"^3.3.2","tinyglobby":"^0.2.10","typescript":"^5.5.4","@types/node":"^22.5.1","@nuxt/schema":"^3.13.0","@antfu/eslint-config":"^3.0.0"},"peerDependencies":{"vite":">=3","rollup":"^3","esbuild":"*","webpack":"^4 || ^5","@nuxt/kit":"^3","@farmfe/core":">=1","@nuxt/schema":"^3"},"peerDependenciesMeta":{"vite":{"optional":true},"rollup":{"optional":true},"esbuild":{"optional":true},"webpack":{"optional":true},"@nuxt/kit":{"optional":true},"@farmfe/core":{"optional":true},"@nuxt/schema":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/unplugin-fluent_0.1.0-beta.1_1730444625055_0.7623244197914492","host":"s3://npm-registry-packages"}},"0.1.0-beta.2":{"name":"@anchanix/unplugin-fluent","version":"0.1.0-beta.2","keywords":["unplugin","vite","webpack","rollup","transform"],"license":"MIT","_id":"@anchanix/unplugin-fluent@0.1.0-beta.2","maintainers":[{"name":"anchanix","email":"sam@anchanix.me"}],"homepage":"https://github.com/smc13/unplugin-fluent#readme","bugs":{"url":"https://github.com/smc13/unplugin-fluent/issues"},"dist":{"shasum":"810029cf469ee774b4df55fd0a3bc5aaaca8012e","tarball":"https://registry.npmjs.org/@anchanix/unplugin-fluent/-/unplugin-fluent-0.1.0-beta.2.tgz","fileCount":50,"integrity":"sha512-SaiZav25+vV+szUqbqPW1LFWzGoLMGzcfblvRsK0VUDib1RXXWM2AfoODobm6lGzQ1HIf9lhtx9o92A9S4K+Aw==","signatures":[{"sig":"MEUCIQCVdyaGBlZzcfSMhufEPICZToAoSxsTA49KamLG57YGhgIgCj4gKtsb1Cqi+RP4U65JwmzThquwfdiiiADe8Y6nNgU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28340},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":"./*","./farm":{"import":"./dist/farm.js","require":"./dist/farm.cjs"},"./nuxt":{"import":"./dist/nuxt.js","require":"./dist/nuxt.cjs"},"./vite":{"import":"./dist/vite.js","require":"./dist/vite.cjs"},"./astro":{"import":"./dist/astro.js","require":"./dist/astro.cjs"},"./types":{"import":"./dist/types.js","require":"./dist/types.cjs"},"./rollup":{"import":"./dist/rollup.js","require":"./dist/rollup.cjs"},"./rspack":{"import":"./dist/rspack.js","require":"./dist/rspack.cjs"},"./esbuild":{"import":"./dist/esbuild.js","require":"./dist/esbuild.cjs"},"./webpack":{"import":"./dist/webpack.js","require":"./dist/webpack.cjs"}},"gitHead":"1ae694395cfe7778f934dc6bd94b8354414db198","scripts":{"dev":"tsup --watch src","lint":"eslint .","play":"npm -C playground run dev","test":"vitest","build":"tsup","start":"esno src/index.ts","release":"bumpp && npm publish","build:fix":"esno scripts/postbuild.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"anchanix","email":"sam@anchanix.me"},"repository":{"url":"git+https://github.com/smc13/unplugin-fluent.git","type":"git"},"_npmVersion":"10.2.3","description":"Plugin for Vite and other bundlers to easily import [project fluent](https://projectfluent.org/) bundles.","directories":{},"_nodeVersion":"21.2.0","dependencies":{"unplugin":"^1.15.0","tinyglobby":"^0.2.10","@anchanix/fluent-utils":"^0.1.0-beta.0"},"typesVersions":{"*":{"*":["./dist/*","./*"]}},"_hasShrinkwrap":false,"packageManager":"pnpm@9.9.0","devDependencies":{"esno":"^4.8.0","tsup":"^8.3.5","vite":"^5.4.10","bumpp":"^9.8.0","chalk":"^5.3.0","eslint":"^9.13.0","rollup":"^4.24.3","vitest":"^2.1.4","nodemon":"^3.1.7","webpack":"^5.96.0","@nuxt/kit":"^3.13.2","fast-glob":"^3.3.2","typescript":"^5.6.3","@types/node":"^22.8.6","@nuxt/schema":"^3.13.2","@antfu/eslint-config":"^3.8.0"},"peerDependencies":{"vite":">=3","rollup":"^3","esbuild":"*","webpack":"^4 || ^5","@nuxt/kit":"^3","@farmfe/core":">=1","@nuxt/schema":"^3","@fluent/bundle":"^0.18.0"},"peerDependenciesMeta":{"vite":{"optional":true},"rollup":{"optional":true},"esbuild":{"optional":true},"webpack":{"optional":true},"@nuxt/kit":{"optional":true},"@farmfe/core":{"optional":true},"@nuxt/schema":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/unplugin-fluent_0.1.0-beta.2_1730452392038_0.32695486313947586","host":"s3://npm-registry-packages"}},"0.1.0-beta.3":{"name":"@anchanix/unplugin-fluent","type":"module","version":"0.1.0-beta.3","packageManager":"pnpm@9.9.0","description":"Plugin for Vite and other bundlers to easily import [project fluent](https://projectfluent.org/) bundles.","license":"MIT","homepage":"https://github.com/smc13/unplugin-fluent#readme","repository":{"type":"git","url":"git+https://github.com/smc13/unplugin-fluent.git"},"bugs":{"url":"https://github.com/smc13/unplugin-fluent/issues"},"keywords":["unplugin","vite","webpack","rollup","transform"],"exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./astro":{"import":"./dist/astro.js","require":"./dist/astro.cjs"},"./rspack":{"import":"./dist/rspack.js","require":"./dist/rspack.cjs"},"./vite":{"import":"./dist/vite.js","require":"./dist/vite.cjs"},"./webpack":{"import":"./dist/webpack.js","require":"./dist/webpack.cjs"},"./rollup":{"import":"./dist/rollup.js","require":"./dist/rollup.cjs"},"./esbuild":{"import":"./dist/esbuild.js","require":"./dist/esbuild.cjs"},"./nuxt":{"import":"./dist/nuxt.js","require":"./dist/nuxt.cjs"},"./farm":{"import":"./dist/farm.js","require":"./dist/farm.cjs"},"./types":{"import":"./dist/types.js","require":"./dist/types.cjs"},"./*":"./*"},"main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","typesVersions":{"*":{"*":["./dist/*","./*"]}},"scripts":{"build":"tsup","dev":"tsup --watch src","build:fix":"esno scripts/postbuild.ts","lint":"eslint .","play":"npm -C playground run dev","prepublishOnly":"npm run build","release":"bumpp && npm publish","start":"esno src/index.ts","test":"vitest"},"peerDependencies":{"@farmfe/core":">=1","@fluent/bundle":"^0.18.0","@nuxt/kit":"^3","@nuxt/schema":"^3","esbuild":"*","rollup":"^3","vite":">=3","webpack":"^4 || ^5"},"peerDependenciesMeta":{"@farmfe/core":{"optional":true},"@nuxt/kit":{"optional":true},"@nuxt/schema":{"optional":true},"esbuild":{"optional":true},"rollup":{"optional":true},"vite":{"optional":true},"webpack":{"optional":true}},"dependencies":{"@anchanix/fluent-utils":"^0.1.0-beta.1","tinyglobby":"^0.2.10","unplugin":"^1.15.0"},"devDependencies":{"@antfu/eslint-config":"^3.8.0","@nuxt/kit":"^3.13.2","@nuxt/schema":"^3.13.2","@types/node":"^22.8.6","bumpp":"^9.8.0","chalk":"^5.3.0","eslint":"^9.13.0","esno":"^4.8.0","fast-glob":"^3.3.2","magic-string":"^0.30.12","nodemon":"^3.1.7","rollup":"^4.24.3","tsup":"^8.3.5","typescript":"^5.6.3","vite":"^5.4.10","vitest":"^2.1.4","webpack":"^5.96.0"},"_id":"@anchanix/unplugin-fluent@0.1.0-beta.3","gitHead":"ed7b700d1e94ba4917b523ff1f59db744d92bfd0","_nodeVersion":"21.2.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-TtJa4ufzOyBVq5lv8Z/I3ciYmqe74jlH+0eRbfZEbgoCBkSqiKj/0hyLqMgfFJ8zIfilUykCe9X+A6L+/J3pwA==","shasum":"9244c7bf5ccab2e112c94503d8e83e64ef617195","tarball":"https://registry.npmjs.org/@anchanix/unplugin-fluent/-/unplugin-fluent-0.1.0-beta.3.tgz","fileCount":50,"unpackedSize":113573,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHcq5mLBdmwIq3qaF3WBXWLjsMQsVcDOE2l9x6xyxdTUAiEA4BYAbezt6U4pH8HuwO/DWLx+jgBt3lQsXGQNNMk3jA8="}]},"_npmUser":{"name":"anchanix","email":"sam@anchanix.me"},"directories":{},"maintainers":[{"name":"anchanix","email":"sam@anchanix.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unplugin-fluent_0.1.0-beta.3_1730933718485_0.30266058999306145"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-01T07:03:44.979Z","modified":"2024-11-06T22:55:18.881Z","0.1.0-beta.1":"2024-11-01T07:03:45.275Z","0.1.0-beta.2":"2024-11-01T09:13:12.200Z","0.1.0-beta.3":"2024-11-06T22:55:18.690Z"},"bugs":{"url":"https://github.com/smc13/unplugin-fluent/issues"},"license":"MIT","homepage":"https://github.com/smc13/unplugin-fluent#readme","keywords":["unplugin","vite","webpack","rollup","transform"],"repository":{"type":"git","url":"git+https://github.com/smc13/unplugin-fluent.git"},"description":"Plugin for Vite and other bundlers to easily import [project fluent](https://projectfluent.org/) bundles.","maintainers":[{"name":"anchanix","email":"sam@anchanix.me"}],"readme":"# @anchanix/unplugin-fluent\n\nPlugin for Vite and other bundlers to easily import\n[project fluent](https://projectfluent.org/) bundles.\n\n## Install\n\n```bash\npnpm add @anchanix/unplugin-fluent\n```\n\n<details>\n<summary>Vite</summary><br>\n\n```ts\n// vite.config.ts\nimport fluent from '@anchanix/unplugin-fluent/vite'\n\nexport default defineConfig({\n  plugins: [\n    fluent({ /* options */ }),\n  ],\n})\n```\n\nExample: [`playground/`](./playground/)\n\n<br></details>\n\n<details>\n<summary>Rollup</summary><br>\n\n```ts\n// rollup.config.js\nimport fluent from '@anchanix/unplugin-fluent/rollup'\n\nexport default {\n  plugins: [\n    fluent({ /* options */ }),\n  ],\n}\n```\n\n<br></details>\n\n<details>\n<summary>Webpack</summary><br>\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('@anchanix/unplugin-fluent/webpack')({ /* options */ })\n  ]\n}\n```\n\n<br></details>\n\n<details>\n<summary>Nuxt</summary><br>\n\n```ts\n// nuxt.config.js\nexport default defineNuxtConfig({\n  modules: [\n    ['@anchanix/unplugin-fluent/nuxt', { /* options */ }],\n  ],\n})\n```\n\n> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)\n\n<br></details>\n\n<details>\n<summary>Vue CLI</summary><br>\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('@anchanix/unplugin-fluent/webpack')({ /* options */ }),\n    ],\n  },\n}\n```\n\n<br></details>\n\n<details>\n<summary>esbuild</summary><br>\n\n```ts\n// esbuild.config.js\nimport { build } from 'esbuild'\nimport fluent from '@anchanix/unplugin-fluent/esbuild'\n\nbuild({\n  plugins: [fluent()],\n})\n```\n\n<br></details>\n\n## Usage\n\n### Importing a single language bundle\n```ts\nimport enBundle from 'virtual:fluent/langs/en-AU'\n```\n\n### Dynamically loading bundles\nTo dynamically load bundles you first have to import the bundle map:\n```ts\nimport bundleMap from 'virtual:fluent/langs/all'\n```\n\nand then in a function you can use the map to load a bundle\n\n```ts\nasync function switchLang(langCode: string) {\n  if (!bundleMap[langCode]) {\n    throw new Error(`Language not supported: ${langCode}`)\n  }\n\n  const bundleImport = await bundleMap[langCode]\n  const bundle = bundleImport.default\n\n  // start using the bundle\n}\n```\n","readmeFilename":"README.md"}