Questions tagged [angular-webpack]
23 questions
                    
                    40
                    
            votes
                
                7 answers
            
        Angular CLI: Change REST API URL on build
I want to remove my local server prefix from my REST API URLs (example, http://localhost:8080) when building for production (ng build --prod). 
I get that it's something to do with the environment file environment.prod.ts, but can't find any…
         
    
    
        karthikaruna
        
- 3,042
- 7
- 26
- 37
                    12
                    
            votes
                
                5 answers
            
        Emit attempted before Angular Webpack plugin initialization after webpack5 build
I'm using Angular 14 and Webpack version: ^5.58.1.
Below is the config:
webpack.congif.js
const webpackPlugin = require('@ngtools/webpack').AngularWebpackPlugin;
module.exports = {
  mode: 'development',
  devtool: "source-map",
  entry: {
    main:…
         
    
    
        Rohit More
        
- 121
- 1
- 1
- 4
                    7
                    
            votes
                
                3 answers
            
        Error: Module build failed - Angular migration to 14.2.2
I have upgraded my angular project from 6.0v to 14.2.2v and after doing ng serve I facing the following errors. I tried deleting the node_modules and installing again and I have also tried to install latest @angular-devkit/build-angular but it didnt…
         
    
    
        Yash Kawadkar
        
- 71
- 1
- 1
- 3
                    6
                    
            votes
                
                4 answers
            
        The template specified for component AppComponent is not a string
disclaimer: Yes, I saw that there are more "The template specified for component AppComponent is not a string" related questions but none of them describes the specific problem I'm experiencing.
I get this runtime error when I compile without AoT in…
         
    
    
        Raz Ronen
        
- 2,418
- 2
- 14
- 26
                    6
                    
            votes
                
                2 answers
            
        angular build with sourcemap but without the URL / reference
I am using angular 6.
I want to debug an app in PROD, I need source map for that.
When I create a build with source map on, it injects the URL at end of minified file as 
//# sourceMappingURL=app.min.js.map
This makes browser call the sourcemap and…
         
    
    
        Akshay
        
- 3,558
- 4
- 43
- 77
                    5
                    
            votes
                
                1 answer
            
        Run customWebpackConfig in Angular 13
I recently updated to Angular 13 from Angular 11 with the latest gratest packages of all components I need and I'm struggling to get the custom-webpack angular builder to run when I perform ng serve.
In my scenario, I perform the CSS optimization…
         
    
    
        Carlos Torrecillas
        
- 4,965
- 7
- 38
- 69
                    3
                    
            votes
                
                0 answers
            
        Angular 6 with SSR and i18n getting error "You must pass in a NgModule or NgModuleFactory to be bootstrapped"
ERROR: https://github.com/mixalistzikas/angular-ssr-i18n
Run `npm run build:all`. Navigate to `http://localhost:4201/`.
I'm trying to make server side rendering with i18n. I have already done this with angular <=5 but now with angular CLI 6, I'm…
         
    
    
        Michalis
        
- 6,686
- 13
- 52
- 78
                    2
                    
            votes
                
                1 answer
            
        Angular seems to build dev dependencies into universal bundle?
I'm using typegoose to unify my interfaces + db schemas shared across ~6 apps. It helps me keep my data structure consistent.
Now that means that most of my types/interfaces in my Angular app are coming from an external project.
Because of this I…
         
    
    
        SebastianG
        
- 8,563
- 8
- 47
- 111
                    1
                    
            vote
                
                0 answers
            
        Images and fonts not loaded as encoded data uri after webpack 5 publish
I am updating my webpack in an angular project to webpack 5 and i am using assets/inline for images, after i publish the application in local and inspect the img src tag i see '../.../../image.png' instead of datauri.
My web pack config looks…
         
    
    
        user1505521
        
- 231
- 1
- 2
- 12
                    1
                    
            vote
                
                1 answer
            
        managing angular 13's angular-webpack cache
I have an Angular 13 and webpack project with about 350 megs of mp3 and mp4 files.  I now have 6 directories in project-dir.angular\cache\angular-webpack each almost a gig in size.  The directories date back a month.
I can easily delete the old…
         
    
    
        Bob Ramsey
        
- 547
- 1
- 6
- 13
                    1
                    
            vote
                
                0 answers
            
        Webpack bundle, directive not resolved
I am trying to bundle using webpack, and also added one custom plugin to dynamic load required modules in bundled file. So, I am able to generate bundle.js file. The directive is not resolved. I can see the directive code in bundle file, but not…
         
    
    
        Anita
        
- 2,352
- 2
- 19
- 30
                    1
                    
            vote
                
                1 answer
            
        Exporting/Importing AngularJS Controllers, Directives, Factories, Services with Webpack 4
I managed to migrate our AngularjS 1.3.15 project from Gulp to Webpack 4, and now I'm trying to organize all our huge 5000+ line files into separate files. The problem is that I have no idea how exactly to export an AngularJS controller or directive…
         
    
    
        Edgar Quintero
        
- 4,223
- 2
- 34
- 37
                    0
                    
            votes
                
                1 answer
            
        Core Angular objects not found building Web Worker in Angular V8
I'm doing my first web worker in an Angular v8 project. I would like to have my web worker make HTTP service calls, just in that separate thread. Unfortunately, during the ng build process, I'm getting a compiler error as shown below. Especially for…
         
    
    
        Woodsman
        
- 901
- 21
- 61
                    0
                    
            votes
                
                1 answer
            
        How can I use webpack "output.devtoolNamespace" in angular
I have an angular application.
In the browser I see the source root as
webpack://src...
I want to use other namespaces like
webpack://web-component-a/...
webpack://web-component-b/...
in webpack documentation I have read I can do this…
         
    
    
        user1782357
        
- 313
- 2
- 11
                    0
                    
            votes
                
                0 answers
            
        WebWorkers and context of imports in Angular
I have a WebWorker where I'm using imports. I'm able to import a class and use it.
I have a file that has 2 classes in it, where one class is using angular, firebase, and other imports for that class; the other class is just a construction class…
         
    
    
        theman0123
        
- 153
- 1
- 17