truffle-react-ts-template
truffle-react-ts-template copied to clipboard
Template for Ethereum DApps. Truffle + React + Typescript
Truffle React TypeScript Template
Getting Started
- Install Truffle and an Ethereum client - like EthereumJS TestRPC.
npm install -g truffle npm install -g ethereumjs-testrpc
- Launch
testrpc
.testrpc <options>
- Migrate the contracts with truffle.
truffle migrate
- Run the webpack server for front-end hot reloading
npm run dev
Tests
This box comes with truffle
contracts testing and front-end testing with jest
- Truffle contract tests
truffle test
- Jest tests
npm run test
Building for Production
- Migrate the contracts with truffle.
truffle migrate
- Create production bundle
npm run build
- The production build will be compiled in the
build/app
folder.
Directory Structure
\build
\app (Production app dist )
\contracts (Migrated contracts)
\config
\jest (Jest config and polyfills)
\contracts (Solidity source)
\migrations (Migration scripts)
\public (Public html)
\src (React app source)
\test (Contract tests)
FAQ
-
My imported CSS doesn't work?
I use CSS modules in webpack. If you don't want it, open
webpack.config.ts
, changemodules: true
tomodules: false
undercss-loader
. -
Can I change what gets included in the vendor bundle?
Open
webpack.config.ts
and edit thevendor_bundle
array underentry
.