MarsiBarsi / angular-library-to-web-components-demo

https://marsibarsi.github.io/angular-library-to-web-components-demo/native-demo/index.html
58 stars 20 forks source link

Error with `elements-webpack.config.js` #39

Open Dok11 opened 1 year ago

Dok11 commented 1 year ago

Just for notice.

const uuidv1 = require('uuidv1');

module.exports = {
  output: {
    jsonpFunction: 'myElements-' + uuidv1(),
    library: 'elements',
  },
};

Trying to build with this config produces an error:

- Generating browser application bundles (phase: setup)...An unhandled exception occurred: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.output has an unknown property 'jsonpFunction'.

To fix it I changed it to:

const uuidv1 = require('uuidv1');

module.exports = {
  output: {
    chunkLoadingGlobal: 'myElements-' + uuidv1(),
    library: 'elements',
  },
};

Error context:

Angular CLI: 15.2.5                                                       
Node: 19.8.1 (Unsupported)                                                
Package Manager: npm 9.5.1                                                
OS: win32 x64                                                             

Angular: 15.2.6                                                           
... animations, common, compiler, compiler-cli, core, elements            
... forms, platform-browser, platform-browser-dynamic, router             

Package                         Version                                   
---------------------------------------------------------                 
@angular-devkit/architect       0.1502.5                                  
@angular-devkit/build-angular   15.2.5                                    
@angular-devkit/core            15.2.5                                    
@angular-devkit/schematics      15.2.5                                    
@angular/cli                    15.2.5                                    
@schematics/angular             15.2.5                                    
ng-packagr                      15.2.2                                    
rxjs                            7.8.0                                     
typescript                      4.9.5