{"id":16384728,"url":"https://github.com/saber2pr/webpack-configer","last_synced_at":"2026-05-13T21:35:21.266Z","repository":{"id":108571715,"uuid":"188045100","full_name":"Saber2pr/webpack-configer","owner":"Saber2pr","description":"a function for webpack config using @types/webpack.","archived":false,"fork":false,"pushed_at":"2019-06-12T01:51:00.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T02:42:21.046Z","etag":null,"topics":["typescript","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Saber2pr.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":"2019-05-22T13:31:29.000Z","updated_at":"2019-06-12T01:51:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"9147ec11-719f-447d-9f8e-4c5ccf6f220a","html_url":"https://github.com/Saber2pr/webpack-configer","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"d34c1fd8d53162fbc7e6729df614a1bcfe367b5f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fwebpack-configer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fwebpack-configer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fwebpack-configer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fwebpack-configer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saber2pr","download_url":"https://codeload.github.com/Saber2pr/webpack-configer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240118329,"owners_count":19750471,"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"],"created_at":"2024-10-11T04:12:12.616Z","updated_at":"2026-05-13T21:35:21.224Z","avatar_url":"https://github.com/Saber2pr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @saber2pr/webpack-configer\n\n\u003e T^T how to config webpack use declaration?\n\n```bash\n# from npm\nnpm install @saber2pr/webpack-configer\n\n# from github\ngit clone https://github.com/Saber2pr/webpack-configer.git\n```\n\n# webpack.config.js\n\n\u003e typescript(tsx) + less\n\n\u003e auto compile, Minify\n\n```js\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\nconst CleanCSSPlugin = require('less-plugin-clean-css')\nconst path = require('path')\n\nconst extractLess = new ExtractTextPlugin('style.css')\n\nconst { WebpackConfig } = require('@saber2pr/webpack-configer')\n\n// use declaration from @types/webpack\nmodule.exports = WebpackConfig({\n  mode: 'development',\n  entry: './src/index.tsx',\n  resolve: {\n    extensions: ['.js', '.ts', '.tsx']\n  },\n  output: {\n    filename: 'bundle.js',\n    path: path.join(__dirname, 'build')\n  },\n  watchOptions: {\n    aggregateTimeout: 300,\n    poll: 1000,\n    ignored: /node_modules/\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.(ts|tsx)$/,\n        use: ['ts-loader']\n      },\n      {\n        test: /\\.less$/,\n        use: extractLess.extract({\n          use: [\n            {\n              loader: 'css-loader'\n            },\n            {\n              loader: 'less-loader',\n              options: {\n                plugins: [\n                  new CleanCSSPlugin({\n                    advanced: true\n                  })\n                ]\n              }\n            }\n          ],\n          fallback: 'style-loader'\n        })\n      }\n    ]\n  },\n  plugins: [new HtmlWebpackPlugin({}), extractLess]\n})\n```\n\n## tsconfig.json\n\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"module\": \"commonjs\",\n    \"esModuleInterop\": true,\n    \"jsx\": \"react\",\n    \"lib\": [\"dom\", \"es2015\"]\n  },\n  \"exclude\": [\"node_modules\", \"lib\"]\n}\n```\n\n---\n\n## start\n\n```bash\nnpm install\n```\n\n```bash\nnpm start\n\nnpm test\n```\n\n\u003e Author: saber2pr\n\n---\n\n## develope and test\n\n\u003e you should write ts in /src\n\n\u003e you should make test in /src/test\n\n\u003e export your core in /src/index.ts!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fwebpack-configer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaber2pr%2Fwebpack-configer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fwebpack-configer/lists"}