Top

Comments

5 comments

  • 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
    Comment actions Permalink
  • Konrad Hyzy

    Hi,

     

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

     

    Konrad

    1
    Comment actions Permalink
  • 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
    Comment actions Permalink
  • 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
    Comment actions Permalink
  • 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
    Comment actions Permalink

Please sign in to leave a comment.

Still can't find what you need?

  • Contact Us

    Do you have any question about Rainbow? Leave us a message to get more information.

    Contact
  • Ask the Community

    Do you need help? Ask your questions to the Community and get answers from other Rainbow users.

    Post message