question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow package.json to define what "ionic build" and "ionic serve" do in custom projects

See original GitHub issue

Looking at CLI 4.8.0, custom projects are hard-coded to always throw an error upon build/serve, without a way to define a custom build/serve process.

I would expect ionic build by default to run tasks that are not specific to Angular, such as auto-generating the app icon and splash screen assets, and allow a hook in the package.json of the project to run other custom build tasks if needed.

This is a small roadblock for Vue adoption.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
imhoffdcommented, Jan 18, 2019

Just pushed a commit that makes this work with projects generated by the Vue CLI.

Choose custom during ionic init:

$ ionic init

ionic.config.json is generated.

{
  "name": "test",
  "integrations": {},
  "type": "custom"
}

Make the following modifications to package.json:

   "scripts": {
+    "ionic:build": "vue-cli-service build",
+    "ionic:serve": "vue-cli-service serve",
     "serve": "vue-cli-service serve",
     "build": "vue-cli-service build",
     "lint": "vue-cli-service lint"
   },

ionic build & ionic serve (and build/serve during Cordova/Capacitor commands) will now work using the vue-cli-service!

This will be in Ionic CLI 4.9.0. Thanks!

0reactions
tomchivertoncommented, Feb 2, 2022

The main AppFlow Vue example project is missing these two lines 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maintain a Global Configuration File - Ionic Framework
Configuration values are stored in JSON files. The Ionic CLI maintains a global configuration file, usually located at ~/.ionic/config.json , and project ......
Read more >
Ionic add custom script with ionic serve - Stack Overflow
Hi if you have ionic cli then you use ionic:build:before in your scripts section of package.json. Example: package.json
Read more >
How to Build Your Own Ionic Library for NPM - Devdactic
The first step to your own custom Ionic library is to generate an Angular library. But this library needs to live inside a...
Read more >
Custom NPM tasks for Ionic projects | by Gregor Srdic - Medium
Initial npm scripts in Ionic starter template project · Custom scripts for building an production release Android apk with a single command.
Read more >
@ionic/app-scripts - npm
Scripts for Ionic Projects. Latest version: 3.2.4, last published: 3 years ago. Start using @ionic/app-scripts in your project by running ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found