An open API service indexing awesome lists of open source software.

https://github.com/lulu-berlin/webpack-typescript-async

Asynchronous module loading with webpack and typescript
https://github.com/lulu-berlin/webpack-typescript-async

asynchronous lazy-loading typescript webpack

Last synced: 2 months ago
JSON representation

Asynchronous module loading with webpack and typescript

Awesome Lists containing this project

README

          

# webpack-typescript-async

This repository is a proof of concept for using webpack with typescript with
``System.import`` for asynchronous module loading.

``System.import`` is better than ``require.ensure`` since it provides
a ``Promise`` and allows to handle exceptions. In order to use it with
typescript, I included the types for systemjs (``@types/systemjs``).

Systemjs is not actually used in the project. The typescript code is compiled
with ``"module": "commonjs"``, but ``System.import`` is recognized by webpack
and converted into bundles that are loaded asynchronously.

## How to start?

```sh
git clone https://github.com/yever/webpack-typescript-async.git
cd webpack-typescript-async
npm install
npm start
```

You can also build it with
```sh
npm run build
```