Giter VIP home page Giter VIP logo

webpack4_mpa_demo's Introduction

webpack4_mpa_demo

webpack4搭建多页面多环境demo

v 1.0.1 改动

增加px2rem,以及rem.js文件(以750设计稿为准) 使用时引入rem.js,设计稿多少px,css就写多少px,自动转换为rem

v 1.0.2 改动

添加公共代码提取,minChunks: 2

v 1.0.3 改动

增加本地调试方法 npm run local 其余方法npm run dev, npm run test等均为build方法,如需变更,请去package.json中以及env-config中自行修改

v 1.0.4 改动

减少部分代码

升级webpack到4.29.6

更改部分依赖位置

个人觉得一般情况下,无需env-config文件(请求地址可以从window.location.origin中获取到),留着只是为了一些特殊情况。
当你不需要env-config文件时,只需区分是npm run dev或npm run build就可以
例如当我在dev、test环境应该执行的是npm run dev,在staging、灰度、master的时候是npm run build
而你们在服务器build的时候,无论是自动部署还是手动部署,只要知道了环境也就能分清是应该运行哪个命令

v 1.0.5 改动

添加html---hot reload,您需要在js文件中require,可查看index文件中index.js

更多详细介绍可以查看 https://juejin.im/post/5b9116086fb9a05d05307e96

webpack4_mpa_demo's People

Contributors

blubiubiu avatar

Watchers

 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.