@opd/pangu

develop tool for pangu project

Usage no npm install needed!

<script type="module">
  import opdPangu from 'https://cdn.skypack.dev/@opd/pangu';
</script>

README

@opd/pangu

pangu devtools for ui engine

Usage

  • Install

    npm i @opd/pangu --dev
    # help
    pangu --help
    
  • Local Develop

    pangu dev
    # help
    pangu dev --help
    
  • Build

    pangu build
    # help
    pangu build --help
    

Custom Webpack Config

  • Function

    // webpack.config.js
    module.exports = function (config) {
      // update config
      return config
    }
    
  • Object

    // webpack.config.js
    module.exports = {
      // your config
    }
    

    config will be merged by webpack-merge

App Config

you can use app.json to customize app config

{
  "appName": "App Name"
}

Fields

  • appName: document.title and process.env.APP_NAME

Theme

you can use theme.json to customize app theme

  • Support extends
  • Support all Ant Design theme variables
{
  "extends": "@ant-design/dark-theme",
  "primary-color": "#1890ff"
}

Environment Variables

Build Time

  • process.env.NODE_ENV: development/production
  • process.env.PORT: Dev Server Port
  • process.env.HOST: Dev Server Host

Run Time

  • process.env.APP_NAME: APP Name
  • process.env.APP_ENV:
    • development: 0
    • test: 1
    • preproduction: 2
    • production: 3
  • process.env.NODE_ENV: development/production

Mock Server

Based on json-server

you can use mocks/db.json to setup mock server, see json-server for more