{"id":15492126,"url":"https://github.com/imjuni/alias-help","last_synced_at":"2025-04-05T07:12:03.949Z","repository":{"id":57176051,"uuid":"378007653","full_name":"imjuni/alias-help","owner":"imjuni","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-22T06:26:07.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-19T10:27:06.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/imjuni.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-18T02:01:19.000Z","updated_at":"2021-06-22T06:26:09.000Z","dependencies_parsed_at":"2022-09-03T23:24:51.827Z","dependency_job_id":null,"html_url":"https://github.com/imjuni/alias-help","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Falias-help","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Falias-help/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Falias-help/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Falias-help/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjuni","download_url":"https://codeload.github.com/imjuni/alias-help/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299850,"owners_count":20916193,"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":[],"created_at":"2024-10-02T07:58:56.007Z","updated_at":"2025-04-05T07:12:03.921Z","avatar_url":"https://github.com/imjuni.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alias-help\nalias-help help module resolution config convert from tsconfig.json to webpack.config.*.js. \n\n# Usage\n```js\nconst aliasHelp = require('alias-help');\n\nconst config = {\n  resolve: {\n    extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],\n    alias: aliasHelp({ configFile: 'tsconfig.json' }),\n    plugins: [\n      new tsconfigPathsWebpackPlugin({\n        configFile: 'tsconfig.json',\n      }),\n    ],\n    fallback: {\n      __dirname: false,\n      __filename: false,\n      console: false,\n      global: false,\n      process: false,\n    },\n  },\n}\n```\n\n# Caution\nLittle bit difference between webpack module resolution configuration and typescript module resolution configuration. typescript module resolution configuration can do group by several directory.\n\n* typescript can do this but webpack don't. \n```json\n{\n  \"compilerOptions\": {\n    \"paths\": {\n      \"@avengers/*\": [\n        \"src/iconman/*\",\n        \"src/hulk/*\"\n      ]\n    }\n  }\n}\n```\n\n## Important\nFollow [webpack official document](https://webpack.js.org/configuration/resolve/) that can pass string array but only works in webpack5.\n\nSo alias-help can do convertion for webpack5. See below.\n\n### AS-IS tsconfig.json\n```json\n{\n  \"compilerOptions\": {\n    \"paths\": {\n      \"@avengers/*\": [\n        \"src/iconman/*\",\n        \"src/hulk/*\"\n      ]\n    }\n  }\n}\n```\n\n### TO-BE json object for webpack5\n```\n{\n  '@avengers': [\n    'src/iconman',\n    'src/hulk'\n  ]\n}\n```\n# Convertion example\nin tsconfig.json\n```\n{\n  \"@src/*\": [\"src/*\"],\n  \"@samsubdir/*\": [\"src/sample-sub-dir/*\"],\n  \"@samdir/*\": [\"../sample-dir/*\"]\n}\n```\n\nto webpack.config.*.js\n```\n{\n  '@src': 'src',\n  '@samsubdir': 'src/sample-sub-dir',\n  '@samdir': '../sample-dir',\n}\n```\n\n# Note\nYou can use extended tsconfig.json file. You have tsconfig.base.json and tsconfig.json file extend that whatever tsconfig extension not a problem. Because alias-help use typescript library for read tsconfig.json.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Falias-help","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjuni%2Falias-help","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Falias-help/lists"}