Module output source isn't being updated when using a Webpack loader
See original GitHub issueDescribe the Bug
I’m trying to use a Webpack loader to automatically import a directive module to a component module when a certain condition has been met. However, it seems to be that even though I update the source to include the HelloModule inside the imports array of the AppModule’s NgModule decorator, it doesn’t seem to be included in the build output. I’m not sure if it’s an issue where I need to add an option to the AngularCompilerPlugin or something else entirely.
Minimal Reproduction
https://github.com/silverAndroid/angular-custom-webpack-inject-module
Expected Behavior
- When the app (from the minimal reproduction repository) loads, there should be a log in the browser console saying ‘hello from the appHello directive’.
- After running a production build, inside
dist/custom-webpack-inject-module/main.js
, there is one instance of ‘./hello/hello.module’ as a comment (meaning that the module was included in the build in the AppModule).
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Libs
- @angular/core version: "~11.2.4"
- @angular-devkit/build-angular version: "~0.1102.3"
- @angular-builders/custom-webpack: "^11.1.1"
For Tooling issues:
- Node version: 12.17.0
- Platform: macOS
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Webpack file-loader outputs [object Module] - Stack Overflow
I encountered this after upgrading file-loader. Looking more carefully at the changelog, I see the default value for esModule changed to true ...
Read more >Output - webpack
This option determines the module's namespace used with the output.devtoolModuleFilenameTemplate . When not specified, it will default to the value of: output.
Read more >Output Management - webpack
Let's fix that with the HtmlWebpackPlugin . Setting up HtmlWebpackPlugin. First install the plugin and adjust the webpack.config.js file: npm ...
Read more >file-loader - webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Writing a Loader - webpack
apply-loader : Executes the function with loader options and returns raw HTML. html-loader : Accepts HTML and outputs a valid JavaScript module. tip....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case you missed it, check out this and this.
@just-jeb I believe so, seems to be a design decision with the Angular Compiler