kevinfrom / webpack-typescript-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack-typescript-example

A webpack with typescript/ts-loader config example

Installation

Run npm install --save-dev to install all dependencies.

Developing

When developing, all typescript must go into the src/index.ts file, either directly or via module imports. Webpack then compiles this file into dist/bundle.js which you can then reference to in your HTML.

Scripts

Script Description Command
build Webpack bundles the project for development. npm run build
build:prod Webpack bundles the project for production. npm run build:prod
watch Webpack watches for changes and bundles the project for development. npm run watch
serve Webpack starts a dev server on port 8080, serving content from the /dist directory. npm run serve
test Runs jest testing, using tests provided in /src/test directory. npm run test

Testing

In the src/test/sayHello.test.ts you will find two prebuilt tests for the sayHi() function from the src/utilities.ts file.

Tests are ran using jest.

Author

Kevin From

npm

Linkedin

Github

About

License:MIT License


Languages

Language:TypeScript 51.2%Language:JavaScript 48.8%