2.0.6 • Published 28 days ago

create-two-scripts v2.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
28 days ago

github-ci NPM downloads NPM version NODE version

EngLish | 中文文档

Introduction

Create-two-scripts, a simple react application front-end scaffolding tool

Description

node >= 10.13.0, webpack >= 5.x and react >= 16.9.x, suppest react + ts/js.

Usage

Install
npm install -g create-two-scripts

// or
yarn global add create-two-scripts
Command
// init project
two init <name>

// start project
two start

// build project
two build
Options

1、Add config file two.config.js

module.exports = {

  entry: {},

  devServer: {
    host: '0.0.0.0',
    port: 3001,
    open: false,
  },
};

2、Support params

nameoptionenvdesc
Use ts-t, --tsdevelopment / productionsupport typescript
Use esbuild-es, --esbuilddevelopment / productionSupport esbuild, ast based babel plugins are not supported.(ex: babel-plugin-import)
Custom port--portdevelopmentSet port inline

use esbuild demo

two start -es
two build -es

use js demo, can support typescript

two start
two build

Reference

https://github.com/facebook/create-react-app