Top

Commentaires

5 commentaires

  • David ROMANÍ

    Making some tests, I found that I can avoid this problem loading rainbowSDK building my Ionic project without "--prod" flag. With this command works well:

    ionic build --engine=browser

    But with this one doesn't works:

    ionic build --prod --engine=browser

    Any hint about what's going on? Thanks.

    0
    Actions pour les commentaires Permalien
  • Konrad Hyzy

    Hi,

     

    try disabling mangle option in your Webpack/minifier settings, that should help.

     

    Konrad

    1
    Actions pour les commentaires Permalien
  • David ROMANÍ

    Well, as a temporal workaround I disabled "optimization" flag inside Ionic production build task config wich is doing the minification (and it works). But is not the desired behaviour because transpiled code is bigger than expected.

     

    // angular.json
    {
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "defaultProject": "app",
    "newProjectRoot": "projects",
    "projects": {
    "app": {
    "root": "",
    "sourceRoot": "src",
    "projectType": "application",
    "prefix": "app",
    "schematics": {},
    "architect": {
    "build": {
    "builder": "@angular-devkit/build-angular:browser",
    "options": {
    "outputPath": "www",
    "index": "src/index.html",
    "main": "src/main.ts",
    "polyfills": "src/polyfills.ts",
    "tsConfig": "tsconfig.app.json",
    "assets": [
    {
    "glob": "**/*",
    "input": "src/assets",
    "output": "assets"
    },
    {
    "glob": "**/*.svg",
    "input": "node_modules/ionicons/dist/ionicons/svg",
    "output": "./svg"
    }
    ],
    "styles": [
    {
    "input": "src/theme/variables.scss"
    },
    {
    "input": "src/global.scss"
    }
    ],
    "scripts": []
    },
    "configurations": {
    "production": {
    "fileReplacements": [
    {
    "replace": "src/environments/environment.ts",
    "with": "src/environments/environment.prod.ts"
    }
    ],
    "optimization": false,
    // ...

     

    Thanks Konrad Hyzy

    0
    Actions pour les commentaires Permalien
  • Konrad Hyzy

    Check if the minifier has a 'mangle' option. For instance, Terser, the default minifier used by Webpack has one: https://webpack.js.org/plugins/terser-webpack-plugin/#terseroptions

    0
    Actions pour les commentaires Permalien
  • David ROMANÍ

    Thanks Konrad Hyzy for your interested again, unfortunately Ionic + Angular + Webpack configuration is actually to hard for me.

    I will keep Googling to try to resolve this problem.

    0
    Actions pour les commentaires Permalien

Vous devez vous connecter pour laisser un commentaire.

Vous n'avez pas trouvé ce que vous cherchez?

  • Contactez-nous

    Vous avez des questions? Laissez-nous un message pour obtenir plus d'informations.

    Contactez-nous
  • Demandez à la Communauté

    Vous avez besoin d'aide? Posez vos questions à la Communauté et obtenez des réponses d'autres utilisateurs Rainbow.

    Poster un message