GithubHelp home page GithubHelp logo

cilor's Introduction

@adiatma2019/cilor

⚡️CLI to compile react project.

Feature

  • support module hot replacement.
  • support flow.
  • support styled-components.
  • support url-loader and file-loader
  • support eslint in develoment mode.
  • support monitoring assets.

How to use?

Please install react and react-dom with @adiatma2019/cilor.

Example.

mkdir react-project
cd react-project

Install with yarn

yarn add -D @adiatma2019/cilor
yarn add react react-dom

Install with npm

npm install --save-dev @adiatma2019/cilor
npm install react react-dom

Create file cilor.config.js in your directory.

// cilor.config.js
const path = require('path')

module.exports = {
  entry: path.resolve(__dirname, 'index.js'),
  output: {
    path: path.resolve(__dirname, 'output'),
  },
  devServer: {
    contentBase: path.resolve(__dirname, 'output'),
  },
  htmlConfig: {
    title: 'Type your title here!',
    elementID: 'app', // default root
  }
}

Create file index.js.

// index.js
import React from 'react'
import ReactDOM from 'react-dom'

function App() {
  return (
    <div>
      <h1>Hello, ReactJS</h1>
      <p>Lorem ipsume sit amet dolor</p>
    </div>
  )
}

const mountElement = document.getElementById('app')
ReactDOM.render(<App />, mountElement)

Open your package.json, and add this command below.

// package.json
{
  "scripts": {
    "start": "cilor cilor.config.js",
    "build": "cilor cilor.config.js build"
  }
}

And start with yarn start or npm start to running development server.

How to add testing environment.

Create .babelrc.js.

const babelConfig = require('@adiatma2019/cilor/src/babel-config')
module.exports = babelConfig('__test__')

Thanks, feel free to contribute!

cilor's People

Contributors

adiatma avatar renovate-bot 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.