Rollup customization

Apologies if this is jumping the gun, but I am struggling with customizing the new build system. The rollup configuration doesn’t seem to cascade, so it seems that I must copy the default settings. However, this does not work easily because the ng-template plugin is not reachable.

All I need to do is to add declarations for an external module and the associated global entry:


  external: [
    "crypto"
  ],

  globals: {
    crypto: "crypto"
  }

How can I do this, especially given the magic involved in swapping development and production settings?

If anybody else is struggling with this, you can modify the top line of the stock config to read like this:

var ngTemplate = require('./node_modules/@ionic/app-scripts/dist/plugins/ng-template').ngTemplate;

Also, until this issue is resolved, instead of using ionic_rollup as an environment configure, you can do this in package.json:

  "scripts": {
    "build": "ionic-app-scripts build -r ./rollup.prod.config.js",
    "watch": "ionic-app-scripts watch -r ./rollup.config.js",
...
1 Like