2 Star 3 Fork 1

emyann / typescript-webpack-starter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

create-ts-lib Build Status Npm Package

A yet another Typescript Webpack Starter

Imgur

Built upon

Quick Overview

npm install -g create-ts-lib

create-ts-lib my-typescript-lib
cd my-typescript-lib/
npm start

Then open http://localhost:3000/ to see your bootstrapped module. When you’re ready to deploy to production, create a minified bundle with npm run build.

Get Started Immediately

You don’t need to install or configure tools like Webpack or Babel.
They are preconfigured so that you can focus on the code, but as a starter kit you still can modify them.

Just create a project, and you’re good to go.

Getting started

Installation

Install it once globally:

npm install -g create-ts-lib

Creating a TypeScript module

To create a new module, run:

create-ts-lib my-ts-module
cd my-ts-module

It will create a directory called my-ts-module inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-ts-module
├── node_modules
├── src
│   └── index.html
│   └── index.spec.ts
│   └── index.ts
│   └── vendor.js
├── tests
│    └── unit
│        └── spec-bundle.js
├── README.md
├── package.json
├── .gitignore
├── karma.conf.js
├── tsconfig.json
├── tslint.json
├── typings.json
└── webpack.config.js

No configuration or complicated folder structures, just the files you need to build your app.
Once the installation is done, you can run some commands inside the project folder:

npm start or npm run server:prod

Runs the app in development / production mode using Webpack dev server. Open http://localhost:3000 🎉 to view it in the browser.

npm test

Runs the unit tests using Karma as test runner and Jasmine as testing framework.

npm run build or npm run build:prod

Build a development release

After build phase, 3 files are generated into the dist folder:

  • app.bundle.js - contains the core of the application. From the entry point src/index.ts
  • vendor.bundle.js - contains the vendor dependencies. From the entry point src/vendor.ts (lodash is added as an example)
  • index.html - html page referencing these files
MIT License Copyright (c) 2017 RENAUDIN Yann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

create-ts-lib: A Starter Kit and a CLI to create your TypeScript / ES6 module bundled by Webpack without thinking about build or unit tests configurations. 展开 收起
TypeScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/emyann/typescript-webpack-starter.git
git@gitee.com:emyann/typescript-webpack-starter.git
emyann
typescript-webpack-starter
typescript-webpack-starter
master

搜索帮助