Giter Site home page Giter Site logo

mpa-cli's Introduction

react多页面应用的模板 技术栈:react16.x + webpack4.x

  1. 安装依赖:
npm install
  1. dev环境服务启动:
npm start
  1. build环境服务启动:
npm run build
  • 启动build之后,项目打包过后的文件会自动打包dist文件下
  • 流水线部署准生产&生产环境

开发和发布版本的配置文件是分开的,多入口页面的目录结构。

    |
    |──dist/                                   * 发布版本构建输出路径
           |
           |
           | —— images
           | —— css
           | —— js
           | —— *.html
    |
    |──public/                                     * html模板
    |
    |──src/
    |     |
    |     |
    |     |—— pages/
    |     |      |—— page1/                     * 页面代码
    |     |      |        |—— main.js            * 入口文件
    |     |      |
    |     |      |—— page2/                    * 页面代码
    |     |      |        |—— main.js            * 入口文件
    |     |
    |     |—— static/                           * 静态文件js,css
    |
  • main.js是每个页面的入口文件,必须有,pages中的文件名就是生成的页面名字;

  • public中index.html是默认html模版文件

mpa-cli's People

Contributors

houkeepmoving avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.