We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
Webpack 的打包流程大致可以归纳为以下几个步骤: 初始化: 启动构建,读取与合并配置参数,加载 Plugin,实例化 Compiler。 编译: 从 Entry 出发,针对每个 Module 串行调用对应的 Loader 去翻译文件的内容,再找出该 Module 依赖的 Module,递归地进行编译处理。 确定 Chunk: 每个 Module 都编译完成后,根据 Module 之间的依赖关系,生成代码块(Chunk)。 生成 Bundle: 每个 Chunk 都转换成一个单独的文件加入到输出列表,这步是可以修改输出内容的最后机会。 输出完成: 确定好输出内容后,根据配置确定的路径与文件名,把文件写入到文件系统。
Sorry, something went wrong.
根据主文件路径读取文件源码,利用 @babel/parser 将源码解析成 AST, 利用 @babel/core 将 AST 转成 ES5 代码 对生成的 AST 进行遍历并解析出当前文件的依赖文件路径, 根据文件路径递归获取到所有文件路径 和文件内容 把每个文件的内容处理成模块形式,并将所有模块写入到一个 IIFE 形式的函数中,最后生成 bundle.js 文件
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: