{"id":23457238,"url":"https://github.com/guoyongfeng/webpack2-library-starter","last_synced_at":"2026-04-11T19:02:37.180Z","repository":{"id":84535010,"uuid":"81396004","full_name":"GuoYongfeng/webpack2-library-starter","owner":"GuoYongfeng","description":"基于webpack2 + ES6开发前端类库","archived":false,"fork":false,"pushed_at":"2017-02-09T02:12:47.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T16:20:13.931Z","etag":null,"topics":["babel","chai","es6","eslint","library","mocha","starter-kit","webpack2","yarn"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/GuoYongfeng.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-09T01:45:07.000Z","updated_at":"2019-05-30T03:29:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7adec57-d350-453c-9360-6c289b3b6853","html_url":"https://github.com/GuoYongfeng/webpack2-library-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GuoYongfeng/webpack2-library-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuoYongfeng%2Fwebpack2-library-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuoYongfeng%2Fwebpack2-library-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuoYongfeng%2Fwebpack2-library-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuoYongfeng%2Fwebpack2-library-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuoYongfeng","download_url":"https://codeload.github.com/GuoYongfeng/webpack2-library-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuoYongfeng%2Fwebpack2-library-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31691503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["babel","chai","es6","eslint","library","mocha","starter-kit","webpack2","yarn"],"created_at":"2024-12-24T04:44:40.971Z","updated_at":"2026-04-11T19:02:37.165Z","avatar_url":"https://github.com/GuoYongfeng.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webpack2 library starter\n\nWebpack based boilerplate for producing libraries (Input: ES6, Output: universal library)\n\n## Features\n\n* Webpack 2 based.\n* ES6 as a source.\n* Exports in a [umd](https://github.com/umdjs/umd) format so your library works everywhere.\n* ES6 test setup with [Mocha](http://mochajs.org/) and [Chai](http://chaijs.com/).\n* Linting with [ESLint](http://eslint.org/).\n* `npm run test:watch` - same as above but in a watch mode\n\n## Process\n\n```\nES6 source files\n       |\n       |\n    webpack\n       |\n       +--- babel, eslint\n       |\n  ready to use\n     library\n  in umd format\n```\n\n*Have in mind that you have to build your library before publishing. The files under the `lib` folder are the ones that should be distributed.*\n\n## Getting started\n\n1. Setting up the name of your library\n  * Open `webpack.config.js` file and change the value of `libraryName` variable.\n  * Open `package.json` file and change the value of `main` property so it matches the name of your library.\n2. Build your library\n  * Run `npm install` to get the project's dependencies\n  * Run `npm run build` to produce minified version of your library.\n3. Development mode\n  * Having all the dependencies installed run `npm run dev`. This command will generate an non-minified version of your library and will run a watcher so you get the compilation on file change.\n4. Running the tests\n  * Run `npm run test`\n\n## Scripts\n\n* `npm run build` - produces production version of your library under the `lib` folder\n* `npm run dev` - produces development version of your library and runs a watcher\n* `npm run test` - well ... it runs the tests :)\n* `npm run test:watch` - same as above but in a watch mode\n\n## Readings\n\n* [Start your own JavaScript library using webpack and ES6](http://krasimirtsonev.com/blog/article/javascript-library-starter-using-webpack-es6)\n\n## Misc\n\n### An example of using dependencies that shouldn’t be resolved by webpack, but should become dependencies of the resulting bundle\n\nIn the following example we are excluding React and Lodash:\n\n```js\n{\n  devtool: 'source-map',\n  output: {\n    path: '...',\n    libraryTarget: 'umd',\n    library: '...'\n  },\n  entry: '...',\n  ...\n  externals: {\n    react: 'react'\n    // Use more complicated mapping for lodash.\n    // We need to access it differently depending\n    // on the environment.\n    lodash: {\n      commonjs: 'lodash',\n      commonjs2: 'lodash',\n      amd: '_',\n      root: '_'\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguoyongfeng%2Fwebpack2-library-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguoyongfeng%2Fwebpack2-library-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguoyongfeng%2Fwebpack2-library-starter/lists"}