{"id":21647998,"url":"https://github.com/atom-community/terser-config-atomic","last_synced_at":"2025-04-11T19:33:24.202Z","repository":{"id":37023019,"uuid":"378791674","full_name":"atom-community/terser-config-atomic","owner":"atom-community","description":"Terser config used in Atom community","archived":false,"fork":false,"pushed_at":"2025-03-29T04:04:52.000Z","size":139,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T05:18:57.790Z","etag":null,"topics":["minify","parcel","rollup","terser","terser-config","terser-preset","uglify","uglifyjs","webpack"],"latest_commit_sha":null,"homepage":"","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/atom-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-21T03:06:03.000Z","updated_at":"2025-03-29T04:04:29.000Z","dependencies_parsed_at":"2025-01-07T11:58:26.502Z","dependency_job_id":null,"html_url":"https://github.com/atom-community/terser-config-atomic","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":"0.21621621621621623","last_synced_commit":"96f8327734b9820144012922e191623bc6238bdf"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-community%2Fterser-config-atomic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-community%2Fterser-config-atomic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-community%2Fterser-config-atomic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-community%2Fterser-config-atomic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atom-community","download_url":"https://codeload.github.com/atom-community/terser-config-atomic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248087864,"owners_count":21045602,"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":["minify","parcel","rollup","terser","terser-config","terser-preset","uglify","uglifyjs","webpack"],"created_at":"2024-11-25T06:52:47.686Z","updated_at":"2025-04-11T19:33:24.182Z","avatar_url":"https://github.com/atom-community.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terser-config-atomic\n\nThe Terser configuration used in atom-community.\n\n## Installation\n\n```\nnpm install --save-dev terser-config-atomic\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eThis package also needs `Terser`.\u003c/summary\u003e\n\nEither add the following to your `.npmrc` if using `pnpm` to hoist the Terser bundled with the config\n\n```\npublic-hoist-pattern[]=*\n```\n\nOr install `terser` yourself in your `devDependencies`.\n\nIf using `npm`, the terser dependency is hoisted automatically.\n\nIf you use `Parcel` or `rullup-plugin-atomic`, `Terser` is already included.\n\n\u003c/details\u003e\n\n## Usage\n\nCreate a `.terserrc.js` with the following content\n\n.terserrc.js\n\n```js\nmodule.exports = require(\"terser-config-atomic\")\n```\n\nThe config is adapted based on `NODE_ENV`, so make sure to run your scripts with the correct `NODE_ENV`:\n\n- test: `cross-env NODE_ENV=test your_test_script`\n- development: `cross-env NODE_ENV=development your_dev_script`\n- production: `cross-env NODE_ENV=production your_prod_script`\n\n**Note**: [`cross-env`](https://www.npmjs.com/package/cross-env) is an npm package that you need to install.\n\n## Options\n\nYou can import the builder function to create a custom config:\n\n```ts\nimport { buildTerserOptions } from \"terser-config-atomic/dist/builder.js\"\nmodule.exports = buildTerserOptions(process.env.NODE_ENV, process.env.BABEL_ENV)\n```\n\nThe builder function:\n\n```ts\n/**\n * Get the terser options for the given environment.\n *\n * @param NODE_ENV - The Node environment (defaults to \"production\").\n * @param BABEL_ENV - The Babel environment (defaults to NODE_ENV).\n * @param unsafeCompress - Whether to use unsafe compression options (defaults to false).\n */\nexport function buildTerserOptions(\n  NODE_ENV: string = \"production\",\n  BABEL_ENV: string | undefined = undefined,\n  unsafeCompress: boolean = false,\n)\n```\n\n## Modifying the config\n\nTo change the config use the following pattern:\n\n.terserrc.js\n\n```js\nconst TerserAtomic = require(\"terser-config-atomic\")\n\nmodule.exports = {\n  ...TerserAtomic,\n  // your config here\n}\n```\n\nTo change the deep properties such as `compress`, use the following pattern as an example:\n\n```js\nconst TerserAtomic = require(\"terser-config-atomic\")\n\nmodule.exports = {\n  ...TerserAtomic,\n  compress: {\n    ...TerserAtomic.compress,\n    ecma: 2020,\n  },\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom-community%2Fterser-config-atomic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatom-community%2Fterser-config-atomic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom-community%2Fterser-config-atomic/lists"}