{"id":16429680,"url":"https://github.com/dominique-mueller/snowpack-plugin-json5","last_synced_at":"2025-04-07T19:48:03.305Z","repository":{"id":40749335,"uuid":"331680941","full_name":"dominique-mueller/snowpack-plugin-json5","owner":"dominique-mueller","description":"Snowpack plugin for using json5","archived":false,"fork":false,"pushed_at":"2023-01-06T18:24:19.000Z","size":988,"stargazers_count":3,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-18T13:58:10.547Z","etag":null,"topics":["json5","plugin","snowpack"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/snowpack-plugin-json5","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dominique-mueller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-21T16:08:08.000Z","updated_at":"2023-03-09T03:19:31.000Z","dependencies_parsed_at":"2023-02-06T07:46:09.448Z","dependency_job_id":null,"html_url":"https://github.com/dominique-mueller/snowpack-plugin-json5","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominique-mueller%2Fsnowpack-plugin-json5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominique-mueller%2Fsnowpack-plugin-json5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominique-mueller%2Fsnowpack-plugin-json5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominique-mueller%2Fsnowpack-plugin-json5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dominique-mueller","download_url":"https://codeload.github.com/dominique-mueller/snowpack-plugin-json5/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247721955,"owners_count":20985083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json5","plugin","snowpack"],"created_at":"2024-10-11T08:24:00.771Z","updated_at":"2025-04-07T19:48:03.286Z","avatar_url":"https://github.com/dominique-mueller.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# snowpack-plugin-json5\n\n**[Snowpack](https://www.snowpack.dev/) plugin for using [json5](https://json5.org/).**\n\n\u003c/div\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\n## What it does\n\nWhen developing web applications, we often use JSON files in order to define content (e.g. for internationalization) or extract some form\nof configuration. Especially in the former case, we usually end up with one or more huge JSON files, probably a couple or hundred or even\nthousand lines long.\n\nUsing [json5](https://json5.org/) over plain json can help organizing, structuring and maintaining those files, e.g. by using comments,\ncustom line breaks and trailing commas (amonst other features).\n\nMeet the **snowpack-plugin-json5**, a plugin for [Snowpack](https://www.snowpack.dev/) that allows you to import `.json5` files just like\nyou would import `json5` files. Think of it as the Snowpack equivalent for the [json5-loader](https://webpack.js.org/loaders/json5-loader/)\nfor [Webpack](https://webpack.js.org/).\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n## How to install\n\nYou can get the **snowpack-plugin-json5** via **npm** by either adding it as a new _devDependency_ to your `package.json` file and running\n`npm install`, or running the following command:\n\n```bash\nnpm install snowpack-plugin-json5\n```\n\n\u003e Note: This plugin is only compatible with Snowpack version `3.x`.\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n## How to setup\n\nTo use **snowpack-plugin-json5**, add it to the list of plugin in your `snowpack.config.js` file. For example:\n\n```diff\n  /** @type {import(\"snowpack\").SnowpackUserConfig } */\n  module.exports = {\n    plugins: [\n+     'snowpack-plugin-json5'\n    ],\n  };\n```\n\nIf you are using TypeScript, you must also define `.json` as a known module type. To do so, add the following declaration to your custom\ntypes file (a file ending with `.d.ts`, sometimes called `typings.d.ts` or `static.d.ts`):\n\n```ts\ndeclare module '*.json5' {\n  const value: any;\n  export default value;\n}\n```\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n## How to use\n\nOnce installed and setup, importing `.json5` files works exactly like importing `.json` files by using default imports (see\n[Snowpack documentation for importing json files](https://www.snowpack.dev/reference/supported-files#json)). For example:\n\n```ts\nimport de from './assets/de.json5';\nimport en from './assets/en.json5';\n\n// ... use the values ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominique-mueller%2Fsnowpack-plugin-json5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominique-mueller%2Fsnowpack-plugin-json5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominique-mueller%2Fsnowpack-plugin-json5/lists"}