Questions tagged webpack

Explore the latest questions and answers asked by our top developers.

Angular 12 + webpack 5 + AOT build – Unable to generate ngfactory file

I am upgrading my Angular 8 projet to Angular 12, also upgrading to webpack 5. The project builds and run fine in dev mode but it does not build in AOT mode. My main-aot.ts file is looking for an app.module.ngfactory file that is not generated. No other error is reported in the process. My questions: […]

By ConnorsFan
Categorized as angular, angular2-aot, webpack Tagged , ,

MVC 5 with Angular 11 hot reloading

I’m trying to setup hot reloading for MVC 5 application along with Angular 11. What I have already achieved: I’m reffering to application bundles in Index.cshtml like this: I’m hosting Angular 11 application like this: ng serve –public-host=https://localhost:4200 –ssl –hmr After I serve angular app and run MVC project, it loads the application nicely. However […]

Webpack remove app.js hash in production mode

I am using Webpack 4 and have recently changed to be using production mode to help optimise the build. A problem I’m having though is the app.js file has now changed to this format ‘app~241218.js’. Is there any way to keep the output as ‘app.js’? Here is a snippet of my webpack config, let me […]

By DeejC
Categorized as angular, webpack, webpack-4 Tagged , ,

Cannot find ‘@ngtools/webpack’ after I run NS RUN ANDROID

I migrated a nx project to nativescript and get these warnings, any ideas how to resolve them? My environment is clean when running tns doctor. I tried npm install nativescript-dev-webpack. $ ns run android Searching for devices… Preparing project… Error: Cannot find module ‘@angular/compiler-cli’ Require stack: – C:[email protected]ugin.js – C:[email protected]srcivyindex.js – C:[email protected]srcindex.js – C:[email protected]bpackdistconfigurationangular.js – […]

By Jussin
Categorized as angular, nativescript, webpack Tagged , ,

Sharing angular libraries among elements throwing error ‘Undefined ng’

My project contains a shell application and uses an angular element called in it, the shell application is called "angular-app" and the element is called "element-app". when loading the project, there is a console error and the element-app is not loading. console error Have already tried the solution in Sharing libraries among angular micro elements […]

By Hitendra Rathore
Categorized as angular, javascript, webpack Tagged , ,

Trying to upgrade from webpack 4 to webpack 5 with my angular app

I am running a hybrid angular/angularjs app with support for IE11. I have a build that works fine in webpack 4 but failing in webpack 5. I followed the upgrade docs and can’t figure out what Im doing wrong.The only difference is I updated my dev dependency and webpack 5. The best I can tell […]

By blankpage985
Categorized as angular, webpack Tagged ,

Reduce production bundle size without AOT/IVY/Optimizer

I know this sounds crazy but I have an app built on Angular 11 which has Ivy, AOT and thereby the bundleoptimizer of webpack turned OFF. If I try to turn them on, it gives a bunch of compile errors(which needs to be looked into before Angular 12). This app is also exposed a webcomponent […]

import css file into es6 returns string instead of object

I’m importing a css file into a typescript module, but the import resolves to a string instead of an object. Can anyone tell me why I don’t get an object?? // preview.ts import test from ‘./src/assets/test.theme.css’ console.log(‘typeof test: ‘, typeof test); console.log(test); Console output: (screenshot) I know, adding an image would be nicer, however, I’m […]

By Markus Windhager
Categorized as angular, css, import, javascript, webpack Tagged , , , ,

import test from "css-loader!./test.css" returns string

Preface I know close to zero about Webpack, Babel, Loaders and how they interact. Problem description I develop an Angular component library that I recently migrated to Angular 12. I am currently setting up Storybook for documentation. I wanted to use the Storybook plugin "@etchteam/storybook-addon-css-variables-theme" to switch between different CSS stylesheets. Through the documentation of […]

How to work with SCSS variables and Mixins in Angular component.scss?

We all know that Angular has component-specific SCSS file for styling which is really a good thing. We mostly write our common/global styles in styles.scss file or any other file which is imported into styles.scss file. Suppose we have variables.scss and mixins.scss file. These files contain variables and mixins. whenever we need to use them […]

By Anwarul Islam
Categorized as angular, sass, webpack Tagged , ,
1 2 3 52

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us