I have a custom rollup.config which works fine the first time i do ‘ionic serve’ but doesn’t after I make changes for the first time and the watcher kicks in.
Note that i have a customized src folder named ‘app’.
I put in some console.logs in the ionic scripts to find out what’s going on. So far I can tell that after each watch trigger the destination path is appended to the previous one, which obviously leads to a wrong path.
Here’s the console output:
The custom rollup config i use looks like this:
var ngTemplate = require('../node_modules/@ionic/app-scripts/dist/plugins/ng-template').ngTemplate;
var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
module.exports = {
sourceMap: true,
format: 'iife',
plugins: [
ngTemplate({
directoryMaps: {
'.tmp': 'app'
}
}),
commonjs(),
nodeResolve({
module: true,
jsnext: true,
main: true,
browser: true,
extensions: ['.js']
})
]
};
and the config value in package.json looks like this:
"config": {
"ionic_src_dir": "app",
"ionic_sass": "configs/sass.config.js",
"ionic_copy": "configs/copy.config.js",
"ionic_rollup": "configs/rollup.config.js"
}