Code Monkey home page Code Monkey logo

Comments (6)

cuantmac avatar cuantmac commented on June 19, 2024

阅读webpack源码时发现并不是每个plugin都有 (before-)run 这个开始执行构建的事件钩子,希望老师讲解下原因。那些没有用这个钩子的plugin 都是怎么开始构建的?

from 2018.10.

ZhangLynn avatar ZhangLynn commented on June 19, 2024

老师能否讲下在实际项目开发中,自己写的比较好的loader和plugin,因为掌握了loader和plugin写法之后觉得不知道怎么应用到实际项目中,缺乏这块经验和概念

from 2018.10.

josephmax avatar josephmax commented on June 19, 2024

两个问题,一个是关于使用happypack和webpack4版本uglify-webpack-plugin
经尝试,使用了happypack创建了js的loader和css的loader,但由于项目没有特别大,速度提升效果不是很明显。大概在什么样的项目规模下充分开启多线程编译能得到性能的提升,有没有相关的经验和参照值可以分享?
同样的问题针对UglifyJS,webpack4以后这个步骤也支持了多线程压缩混淆,同想得到一些实际应用到工程中的配置案例。

from 2018.10.

josephmax avatar josephmax commented on June 19, 2024

另一个问题是关于使用dynamic import syntax,
因为项目中使用了react-loadable,有些地方需要借助
() => import('path/to/component')来实现代码分割,这个时候webpack中配置的alias似乎就无法被很好地编译进去了。如果不自己写plugin,有没有现成的方案可以让import动态解析的路径也支持配好的alias呢?�

from 2018.10.

miniflycn avatar miniflycn commented on June 19, 2024

@zhulin2609 朱老师,来回答下啊。

from 2018.10.

zhulin2609 avatar zhulin2609 commented on June 19, 2024

阅读webpack源码时发现并不是每个plugin都有 (before-)run 这个开始执行构建的事件钩子,希望老师讲解下原因。那些没有用这个钩子的plugin 都是怎么开始构建的?

https://www.webpackjs.com/api/compiler-hooks/ plugin触发的事件钩子并不限于(before-)run,emit等也可以的,homework就有提现。

from 2018.10.

Related Issues (20)

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.