-
-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
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
feat(angular): adding initial support #3009
feat(angular): adding initial support #3009
Conversation
feat: add EntryPlugin as a workaround
|
Let me solve the conflicts and we are good to merge. Thanks for your guys and great work! |
Those |
Related issue (if exists)
A large portion of this work is copy pasted from the initial angular support task by @edusperoni but is a new branch because copy pasting was easier for me to get a new branch off of main.
Angular Support Tracking Issue
Angular Support Request
Closes these PRs as well:
Angular WIP
Angular WIP 2
Summary
🤖 Generated by Copilot at e2aaf1b
This pull request adds a new example of using
rspack
with Angular and updates the debugger configurations for Visual Studio Code. It also introduces a new hook forrspack
that allows custom logic to run before compilation. It modifies thenode_binding
andrspack_core
crates to support the new hook and thename
field for the stats. It adds new files for the Angular project, such as the configuration, module, component, and test files. It uses the@angular-devkit/build-angular:browser-esbuild
builder and some plugins from the@angular-devkit/build-angular
package to integrate withrspack
.Walkthrough
🤖 Generated by Copilot at e2aaf1b
rspack
to bundle an Angular project (F9-F18)@angular-devkit/build-angular:browser-esbuild
builder to useesbuild
instead ofwebpack
(link)@rspack/cli
and@rspack/plugin-minify
packages as devDependencies (link)rspack
command with various options and plugins (link)launch.json
file for the Visual Studio Code debugger to use the new example and add a new configuration for debugging the Rust code (link, link)Hook
enum and a new match arm to thefrom_str
function in thecrates/node_binding/src/hook.rs
file (link, link)Hooks
struct in thecrates/node_binding/src/js_values/hooks.rs
file to hold the reference to the JavaScript function for thebeforeCompile
hook (link)Stats
struct in thecrates/node_binding/src/js_values/stats.rs
andcrates/rspack_core/src/stats.rs
files to hold the name of the compilation (link, link)from_stats
function in thecrates/node_binding/src/js_values/stats.rs
file and thefrom_details
function in thecrates/rspack_core/src/stats.rs
file to set thename
field of theStats
struct (link, link)Plugin
struct in thecrates/node_binding/src/plugins/mod.rs
file to handle thebeforeCompile
hook (link, link, link)PluginBuilder
struct in thecrates/node_binding/src/plugins/mod.rs
file to create a threadsafe function from thebeforeCompile
hook function (link, link)compile
method of theCompiler
struct in thecrates/rspack_core/src/compiler/mod.rs
file to call thebefore_compile
method of theplugin_driver
field (link)Plugin
trait in thecrates/rspack_core/src/plugin/api.rs
file with a default implementation that does nothing (link)PluginDriver
struct in thecrates/rspack_core/src/plugin/plugin_driver.rs
file that iterates over the plugins and calls thebefore_compile
method of each plugin (link)