'ionic-app-scripts serve' takes ~90 seconds to compile


#1

Short description of the problem:

“ionic:serve” takes ~90 seconds to compile

What behavior are you expecting?

Less than 15 seconds of compile time. Please let me know if 90 seconds is a normal duration for an ionic2 project to run.

Steps to reproduce:

  1. clone ‘https://github.com/ugurdonmez/kinder-mobile/tree/pages-fix’ branch
  2. run ‘npm install’ on project directory
  3. run ‘ionic:serve’

Versions
I just removed node_modules folder and rerunned ‘npm install’, but here are some versions:
@ionic/app-scripts: 1.3.7
@angular/common: 2.4.8
ionic-native: 2.9.0
ionic-angular@2.3.0
Windows_NT: 10.0.14393
node: v6.9.5
npm: v3.10.10

Other information:
For “ionic run browser”, it is even longer than 90 seconds.

package.json:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve",
    "ionic:run": "ionic run browser"
  },
  "dependencies": {
    "@angular/common": "2.4.8",
    "@angular/compiler": "2.4.8",
    "@angular/compiler-cli": "2.4.8",
    "@angular/core": "2.4.8",
    "@angular/forms": "2.4.8",
    "@angular/http": "2.4.8",
    "@angular/platform-browser": "2.4.8",
    "@angular/platform-browser-dynamic": "2.4.8",
    "@angular/platform-server": "2.4.8",
    "@ionic/storage": "1.1.x",
    "angularfire2": "2.0.0-beta.8",
    "firebase": "3.7.x",
    "ionic-angular": "2.3.x",
    "ionic-native": "^2.2.17",
    "ionicons": "3.0.0",
    "ng2-translate": "^5.0.0",
    "rxjs": "5.0.1",
    "zone.js": "0.7.2",
    "sw-toolbox": "*"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.x",
    "typescript": "2.3.x",
    "cordova": "6.5.x"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard",
    "cordova-plugin-camera"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],
  "description": "kinder-mobile: An Ionic project"
}

tsconfig.json

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es2015"
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

tslint.json:

{
  "rules": {
    "no-duplicate-variable": true,
    "no-unused-variable": [
      false
    ]
  },
  "rulesDirectory": [
    "node_modules/tslint-eslint-rules/dist/rules"
  ]
}

#2

What are these .x in package.json?


#3

Hello, I left them as .x intentionally to always get the latest patches. Is this a bad idea? I’m not familiar with best practices in javascript world. Thanks for answering


#4

My compile time just decreased to 16 seconds by restarting my computer. The issue is solved. I apologize for keeping the forum busy unnecessarily.