Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mike-engel/preact-cli-typescript-sample
An example of how to use typescript with preact-cli and all its goodies
https://github.com/mike-engel/preact-cli-typescript-sample
bundle-splitting code-splitting example example-app example-code example-project preact preact-app preact-cli types typescript webpack webpack3
Last synced: about 1 month ago
JSON representation
An example of how to use typescript with preact-cli and all its goodies
- Host: GitHub
- URL: https://github.com/mike-engel/preact-cli-typescript-sample
- Owner: mike-engel
- License: other
- Archived: true
- Created: 2017-09-08T21:43:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-14T03:52:35.000Z (about 7 years ago)
- Last Synced: 2024-09-24T20:03:58.768Z (about 1 month ago)
- Topics: bundle-splitting, code-splitting, example, example-app, example-code, example-project, preact, preact-app, preact-cli, types, typescript, webpack, webpack3
- Language: TypeScript
- Size: 174 KB
- Stars: 17
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-list - preact-cli-typescript-sample - cli and all its goodies | mike-engel | 17 | (TypeScript)
README
# preact-cli-typescript-example
> An example of how to use typescript with preact-cli and all its goodies
# Why?
[Preact](https://preactjs.com) and [preact-cli](https://github.com/developit/preact-cli) are awesome! [Typescript](https://typescriptlang.org) is awesome! Trying to use them together out of the box, however, is not so awesome. There are some cool projects like [`preact-cli-plugin-typescript`](https://github.com/wub/preact-cli-plugin-typescript) help a little, but I still found myself fighting to get it to build and include ideas like code splitting. So that's why I made this repo while working on a side project.
# Installing
Begin by cloning or forking this repo with git or github. Once you have it on your machine, run the following commands.
```sh
# install dependencies
npm install# start the web app and development server
npm start
```At this point, you should be able to open your browser and go to [localhost:8080](http://localhost:8080). You'll notice that the app compiles and also includes code splitting!
# Deploying
While this app doesn't do much on it's own, if you want to deploy it somewhere to see the lighthouse score or offline capabilities, run the build command and serve/upload those files somewhere. I recommend [now.sh](https://now.sh).
```sh
# build the app into a static set of files
npm run build# deploy somewhere. This example uses now.sh
now ./build
```# Contributing
I'd love to get your feedback and suggestions via issues and pull requests on this repo! All I ask is that you follow the [code of conduct](#code-of-conduct).
# [Code of Conduct](CODE_OF_CONDUCT.md)
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
# [License](LICENSE.md)