Code Monkey home page Code Monkey logo

react-with-nodemon's Introduction

Local setup for developing React library with nodemon

Have you ever wondered why don't we use nodemon in react development? If you are wondering how to develop a local react library and test it in sample application, this might help you.

Get Started

git clone https://github.com/theajr/react-with-nodemon.git my-react-pkg
cd my-react-pkg
npm i
npm start

Change name in package.json to your desire package name, example: my-react-pkg

Now you can change any js file in src folder and it will automatically transpile the code to dist.

Usage

You can keep making changes in this package and test in your sample project at the same time.

cd mySampleReactApp
npm install ABSOULTE_PATH_OF_CLONED_PACKAGE

Now, you can import your package into mySampleReactApp, Let's say you have an App.jsx in your mySampleReactApp

import React from "react";
import PropTypes from "prop-types";
import { Button } from "my-react-pkg";

const App = ({ name }) => {
  return (
    <div>
      Hello {name}
      <br />
      <Button text="Counter - " />
    </div>
  );
};

App.propTypes = {
  name: PropTypes.string.isRequired
};

export default App;

Publish you package!

cd my-react-pkg
npm run compile
npm login
npm publish

โœ… Done! You have published your package successfully! ๐Ÿ‘๐Ÿ’ฅ๐ŸŽ‰

Limitations

  • No support for other imports than js/jsx

react-with-nodemon's People

Contributors

theajr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.