-
Notifications
You must be signed in to change notification settings - Fork 12k
@ngtools/webpack - Limited number of AotPlugin instances #5072
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
Comments
In my opinion, webpack's multi-entries is essential feature; In typical large-scale enterprise system, Application must be devided into multiple SPA to supress memory usage in web-browser. ( Another solution, using single-SPA with lazy loading, is effective only in first-time loading, but in total memory usage.) But this issue is labeled 'nice to have', not 'required'. ( Using ngc cli directly before webpacking ? But we no longer use @ngtools/webpack in that case...) Any idea ? |
@ytkj @filipesilva yea i agree. we went ahead with an adoption of ng2+ at our company with assumption this bug would be resolved by the time we got close to moving to production, now i'm getting a bit nervous! Are there any hacks or workarounds we can use until official support lands? |
@tavelli workaround I can come up with is quite primitive:
To automate build process, step 1 should be done by a task-runner such as npm-script or Gulp. |
@tavelli have you found a hack or workaround? |
Nope :(
I've been using JIT compiler. With tree shaking and minification bundle isn't quite as huge as I thought it would be but I believe execution time still suffers vs AOT so its far from ideal.
… On Jul 5, 2017, at 9:37 AM, Nathan ***@***.***> wrote:
@tavelli have you found a hack or workaround?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
For a while I did this: package.json snippet
My In this way Webpack can be used in development with JIT, while pure ngc+rollup can be used for AOT building. Not the most ideal imo, since I'd rather just use one tool (webpack) and not have to jump into ngc directly - but it is a valid approach. I'm investigating migrating to webpack, but perhaps I'll still need to do this if I have multiple entry point : |
related to #7954 |
While this get fixed, I published a npm package with some modifications to handle multiple entry modules: |
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: #5072
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…tion This change allows multiple instances of the `AngularWebpackPlugin` to be present in a Webpack configuration. Each plugin instance should reference a different TypeScript configuration file (`tsconfig.json`) and the TypeScript configuration files should be setup to not include source files present in the other TypeScript configuration files. If files are included in more than one TypeScript configuration, the first plugin present in the Webpack configuration that can emit the file will be used. Closes: angular#5072
Hello there. I might be wrong, but it seems that, at the moment, @ngtools/webpack doesn' support multiple entry points. The way it was possible to have multiple Angular client apps built by the same webpack instance was, e.g. using awesome-webpack-loader, something like this:
As you can see, this config enables it to build two different angular apps (that are package dependencies of the main one that runs webpack), each containing its own tsconfig, typings etc., by scoping each loader instance using 'include' to its own directory.
However, @ngtools/webpack provides the AOT functionality through the AotPlugin, which throws the
An @ngtools/webpack plugin already exist for this compilation.
exception if you try creating more than one instance.So my question is, why is the number of AotPlugin instances restricted? Is there another way to support multiple entry points? If not, are there to plans to support it, or an issue where it can be tracked (since all issues concerning the webpack loader are in the angular-cli repository, which makes it really hard to track)?
The text was updated successfully, but these errors were encountered: