1.3.0 • Published 4 years ago

riant-scripts v1.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

riant-scripts

npm package

Create your app using create-react-app , and tweak the create-react-app webpack config(s) , especially preset less-loader and stylus-loader .

NPM version NPM Downloads

English Documentation

中文文档

Install riant-scripts

$ npm install riant-scripts --save-dev

Schema

/* riant.config.js */
module.exports = {
  alias: { instanceof: ['Function', 'Object'] },
  babelPlugins: { instanceof: ['Function', 'Array'] },
  chainWebpack: { instanceof: 'Function' },
  configureWebpack: { instanceof: 'Function' },
  css: {
    type: 'object',
    properties: {
      modules: { type: 'boolean' },
      sourceMap: { type: 'boolean' },
      loaderOptions: {
        type: 'object',
        properties: {
          css: { type: 'object' },
          less: { type: 'object' },
          stylus: { type: 'object' },
          postcss: { type: 'object' }
        }
      }
    }
  },
  define: { instanceof: ['Function', 'Object'] },
  devServer: { instanceof: ['Function', 'Object'] },
  extensions: { instanceof: ['Function', 'Array'] },
  externals: { instanceof: ['Function', 'Array', 'RegExp', 'Object'] },
  filenameHashing: { type: 'boolean' },
  jest: { instanceof: ['Function', 'Object'] },
  pages: { type: 'object' },
  parallel: { type: ['boolean', 'number'] },
  paths: { instanceof: ['Function', 'Object'] },
  riantPlugins: { instanceof: 'Array' },
  useEslintrc: { type: 'boolean' }
}

Code Structure

+-- your-project
|   +-- riant.config.js
|   +-- node_modules
|   +-- package.json
|   +-- public
|   +-- README.md
|   +-- src

Use riant-scripts instead of react-scripts in npm scripts of package.json for start、build and test

  /* package.json */

  "scripts": {
-   "start": "react-scripts start",
+   "start": "riant-scripts start",
-   "build": "react-scripts build",
+   "build": "riant-scripts build",
-   "test": "react-scripts test --env=jsdom",
+   "test": "riant-scripts test --env=jsdom",
    "eject": "react-scripts eject"
}

Note: Keep the eject script. That gets run only once for a project, after which you are given full control over the webpack configuration making riant-scripts no longer required.

Start the Dev Server

$ npm start

Build your app

$ npm run build
1.4.0-0

4 years ago

1.3.1

4 years ago

1.3.1-0

4 years ago

1.3.0

4 years ago

1.3.0-1

4 years ago

1.3.0-0

4 years ago

1.2.0

4 years ago

1.2.0-3

4 years ago

1.2.0-2

4 years ago

1.2.0-1

4 years ago

1.2.0-0

4 years ago

1.1.5-1

4 years ago

1.1.4

4 years ago

1.1.4-8

4 years ago

1.1.4-7

4 years ago

1.1.4-6

4 years ago

1.1.4-5

4 years ago

1.1.4-4

4 years ago

1.1.4-3

4 years ago

1.1.4-2

4 years ago

1.1.4-1

4 years ago

1.1.3

4 years ago

1.1.3-1

4 years ago

1.1.2

4 years ago

1.1.2-3

4 years ago

1.1.2-2

4 years ago

1.1.2-1

4 years ago

1.1.1

4 years ago

1.1.1-2

4 years ago

1.1.1-1

4 years ago

1.1.0

4 years ago

1.1.0-1

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago