Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
/ happo-cra-typescript Public archive

An example TypeScript project generated with create-react-app, integrated with happo.io

Notifications You must be signed in to change notification settings

happo/happo-cra-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

This repository hasn't been updated in a while. Look into docs.happo.io for more up-to-date documentation.

This is an example project demonstrating how happo.io can be used in a TypeScript project generated by create-react-app.

For those of you looking for a copy-paste solution, these are the steps involved in getting happo integrated with create-react-app:

1. Add required dependencies:

yarn add --dev happo.io babel-loader

2. Configure .happo.js:

const craWebpackConfig = require('react-scripts/config/webpack.config')

module.exports = {
  customizeWebpackConfig: config => {
    // Use the built-in webpack config provided by create-react-app
    config.module = craWebpackConfig('development').module;
    return config;
  },
};

3. Create a test file, e.g. Button-happo.tsx:

import React from 'react';

export default () => <button>Click me</button>;

4. Add a happo script to package.json:

"scripts": {
  "happo": "NODE_ENV=development happo"
},

5. Run happo!

yarn happo run

About

An example TypeScript project generated with create-react-app, integrated with happo.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published