Skip to content

A Play seed project with some useful plugins and a state of the art front end setup based on Webpack, TypeScript and React.

License

Notifications You must be signed in to change notification settings

digital-wonderland/play-webpack-typescript-react

Repository files navigation

Play Framework, Webpack, TypeScript, React with Hot Module Reloading, ...

A Play seed project with some useful plugins and a state of the art frontend setup based on Webpack, TypeScript and React.

Note: If you prefer the classic layout of a Play application, check out the first commit of this repository.

Content:

Backend:

Frontend:

Usage:

Webpack is fully integrated into sbt.

Whenever you run Play in development mode (via run) it will listen to http://localhost:9000 and webpack-dev-server will proxy this at http://localhost:2992.

Browsersync will proxy webpack-dev-server at http://localhost:3000 with its UI being available at http://localhost:3001 and http://0.0.0.0:3000 being the external address.

Whenever you run Play in production mode (via dist, stage or start) webpack will generate optimized builds, which get included automatically (including asset fingerprinting and gzipping).

The plugins scalafmt, linter and wartremover are integrated into compilation. scapegoat must be run manually by running scapegoat within sbt.

Testing:

Tests with Jest can be run with

$ npm test

There are also options to generate test coverage or do ongoing testing, whenever some source file changes (similiar to ~test in sbt).

Last but not least:

This project has absolutely no claim to be complete or to be the single answer to everything. It merely exists cause I got tired of creating such a setup each time from scratch and because it allows for easy modification - like adding more optimizations to the frontend release builds.

Any pull requests are totally welcome :)

About

A Play seed project with some useful plugins and a state of the art front end setup based on Webpack, TypeScript and React.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published