Coder Social home page Coder Social logo

learn-webpack's Introduction

learn-webpack

stage1

了解webpack的 entryoutput 执行 npm run webpack1

stage2

了解webpack的 loader 执行 npm run webpack2

stage3

如何写一个 loader ,加载vue文件,并将{{}}里的内容替换成option里的配置 执行 npm run webpack3

stage4

了解webpack的 plugin 执行 npm run webpack4

stage5

如何写一个plugin 执行 npm run webpack5

stage6

tree shaking

stage7

使用dlls插件进行拆解打包

stage8

使用happy插件多进程处理

stage9

性能优化建议:

  1. 先进行性能分析
  • 使用 speed-measure-webpack-plugin 插件找出用时慢的loader和plugin
  • 使用 webpack-bundle-analyzer 插件分析bundle
  1. 升级最新的 webpack 版本。webpack自身会进行性能优化
  2. 将loader应用于更少的模块
  3. 减少resolve.extensions的类目,因为他们会增加文件系统调用的次数
  4. 减少编译体积 small = faster
  5. 生产环境不要使用source-map

learn-webpack's People

Contributors

zhoulang27426405 avatar

Watchers

 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.