Trying to build the most efficient, smallest web build to prepare to move to a PWA.
I see sooooo many polyfills.js type files everywhere. My understanding is those are for old browsers that don’t support HTML5. Is that correct?
How can I do a build without all that? The lightest weight build for www? Don’t all modern browsers support HTML5? Firefox, Chrome, Safari?
Also, when trying a build using “ionic build --prod”, which I have read helps create a nice, lightweight build, I end up with the following type errors. Any insight into these?
A standard “ionic build” has no errors.
$ ionic build --prod --verbose
ionic:bootstrap local CLI 4.6.0 found at /Users/myUsername/Desktop/devDirExp/node_modules/ionic/package.json +0ms
ionic:lib Terminal info: { tty: true, ci: false, windows: false } +0ms
ionic:lib CLI global options: { _: [ ‘build’ ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, prod: true, project: null, ‘–’: } +2ms
ionic:lib:project Project type from config: Ionic 2/3 (ionic-angular) +0ms
ionic:lib:project Project details: { configPath: ‘/Users/myUsername/Desktop/devDirExp/ionic.config.json’, errors: , context: ‘app’, type: ‘ionic-angular’ } +0ms
ionic Context: { binPath: ‘/Users/myUsername/Desktop/devDirExp/node_modules/ionic/bin/ionic’, libPath: ‘/Users/myUsername/Desktop/devDirExp/node_modules/ionic’, execPath: ‘/Users/myUsername/Desktop/devDirExp’, version: ‘4.6.0’ } +0ms
ionic:lib:telemetry Sending telemetry for command: ‘ionic build’ [ ‘–prod’, ‘–verbose’, ‘–interactive’, ‘–color’ ] +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:project:ionic-angular:build Looking for ionic:build npm script. +0ms
ionic:lib:project:ionic-angular:build Found ionic:build, but it is the default. Not running. +5ms
ionic-app-scripts build --prod
[18:29:38] ionic-app-scripts 3.2.4
[18:29:38] build prod started …
[18:29:38] clean started …
[18:29:38] clean finished in 1 ms
[18:29:38] copy started …
[18:29:38] deeplinks started …
[18:29:38] deeplinks finished in 170 ms
[18:29:38] ngc started …
[18:29:40] ionic-app-script task: “build”
[18:29:40] Error: Metadata version mismatch for module
/Users/myUsername/Desktop/devDirExp/node_modules/@ionic-native/core/decorators.d.ts, found version 4,
expected 3
Error: Metadata version mismatch for module /Users/myUsername/Desktop/devDirExp/node_modules/@ionic-native/core/decorators.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (/Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler/bundles/compiler.umd.js:23979:34)
at StaticSymbolResolver._createSymbolsOf (/Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler/bundles/compiler.umd.js:23765:46)
at StaticSymbolResolver.getSymbolsOf (/Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler/bundles/compiler.umd.js:23746:14)
at /Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler/bundles/compiler.umd.js:22528:30
at Array.forEach ()
at extractProgramSymbols (/Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler/bundles/compiler.umd.js:22527:79)
at AotCompiler.compileAll (/Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler/bundles/compiler.umd.js:22225:47)
at CodeGenerator.codegen (/Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler-cli/src/codegen.js:30:14)
at Function.NgTools_InternalApi_NG_2.codeGen (/Users/myUsername/Desktop/devDirExp/node_modules/@angular/compiler-cli/src/ngtools_api.js:61:30)
at /Users/myUsername/Desktop/devDirExp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:182:73
[ERROR] An error occurred while running subprocess ionic-app-scripts.ionic-app-scripts build --prod exited with exit code 1. Re-running this command with the --verbose flag may provide more information.