How to configure the steps that are performed during the assembly of ionic applications?

I want to start using tslint 4, but ionic app scripts do not yet support it: https://github.com/driftyco/ionic-app-scripts/issues/649

I have successfully configured the lint script (in package.json) to run ng lintinstead of ionic-app-scripts lintat startup npm run lint:

  "scripts": {
    "build": "ionic-app-scripts build",
    "lint": "ng lint",
    ...
  }

However, this change does not affect the build script. Build is still performed with ionic-app-scripts lintinstead ng lint.

Can I configure which commands run in the build script?

+5
source share
1 answer

If this question is quite old, then this is an attempt that I always use, since it worked for me in different projects:

, .

:

"scripts": {
    "build": "ng lint && ionic-app-scripts build",
    "lint": "ng lint",
}

:

"scripts": {
    "build": "ionic-app-scripts build",
    "lint": "ng lint",
    "linted-build": "npm run lint && npm run build"
}

, &&, . → , linting. , &. , ;)

0

Source: https://habr.com/ru/post/1673742/


All Articles