{"id":15688296,"url":"https://github.com/jonaskello/typescript-webpack-minimal","last_synced_at":"2025-05-07T21:02:40.433Z","repository":{"id":81765657,"uuid":"84125691","full_name":"jonaskello/typescript-webpack-minimal","owner":"jonaskello","description":"Mininal setup for using typescript with webpack","archived":false,"fork":false,"pushed_at":"2017-03-08T08:39:05.000Z","size":25,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T14:06:39.585Z","etag":null,"topics":["typescript","webpack","webpack2"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonaskello.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-03-06T22:04:57.000Z","updated_at":"2022-07-15T08:48:45.000Z","dependencies_parsed_at":"2023-03-12T05:15:57.671Z","dependency_job_id":null,"html_url":"https://github.com/jonaskello/typescript-webpack-minimal","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/jonaskello%2Ftypescript-webpack-minimal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaskello%2Ftypescript-webpack-minimal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaskello%2Ftypescript-webpack-minimal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaskello%2Ftypescript-webpack-minimal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonaskello","download_url":"https://codeload.github.com/jonaskello/typescript-webpack-minimal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954376,"owners_count":21830902,"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":["typescript","webpack","webpack2"],"created_at":"2024-10-03T17:57:27.490Z","updated_at":"2025-05-07T21:02:40.170Z","avatar_url":"https://github.com/jonaskello.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# typescript-webpack-minimal\nMininal setup for using typescript with webpack\n\n# How to use\n\n```\nyarn install\nyarn start\n# Open your browser to the url noted in output (usually localhost:8008)\n```\n\n# How to reproduce\n\nThe setup can be reproduced by running these commands:\n\n```\nmkdir typescript-webpack-minimal\ncd typescript-webpack-minimal\nyarn init -y\nyarn add --dev typescript webpack ts-loader webpack-dev-server\n./node_modules/typescript/bin/tsc --init\n```\n\nReplace last `}` in package.json with:\n```\n  ,\n  \"scripts\": {\n    \"start\": \"webpack-dev-server\",\n    \"tsc\": \"tsc\"\n  }\n}\n```\n\nCreate webpack.config.js\n```\nvar path = require(\"path\");\n\nmodule.exports = {\n  resolve: {\n    extensions: ['.ts', '.tsx', '.js']\n  },\n  entry: \"./src/index.tsx\",\n  output: {\n    filename: \"bundle.js\",\n    path: path.resolve(__dirname, \"dist\"),\n    publicPath: \"/dist/\"\n  },\n  module: {\n    rules: [\n      { test: /\\.tsx?$/, loader: \"ts-loader\" }\n    ]\n  },\n  devServer: {\n    stats: {\n      assets: false,\n      hash: false,\n      chunks: false,\n      errors: true,\n      errorDetails: true,\n    },\n    overlay: true\n  }\n};\n```\n\nCreate index.html\n```\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003etypescript-webpack-minimal\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"root\"\u003e\u003c/div\u003e\n    \u003cscript src=\"dist/bundle.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nCreate src/index.tsx\n```\nconst x: number = 42;\nconst message: string = `Hello ${x}`;\ndocument.getElementById(\"root\").innerHTML = message;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaskello%2Ftypescript-webpack-minimal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonaskello%2Ftypescript-webpack-minimal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaskello%2Ftypescript-webpack-minimal/lists"}