Skip to content

rollup cache is not invalidated when external templates or styles are edited #34

@robianmcd

Description

@robianmcd

If I enable rollup's cache option then changes to html files and css files will be ignored until their component is edited. e.g. with the following gulpfile

var gulp = require('gulp');
var rollup = require('rollup').rollup;
var angular = require('rollup-plugin-angular');
var typescript = require('rollup-plugin-typescript');
var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');

var rollUpBundle;
gulp.task('rollup', function () {
    var rollupConfig = {
        entry: 'src/app.component.ts',
        cache: rollUpBundle,
        plugins: [
            angular(),
            typescript(),
            nodeResolve({ jsnext: true, main: true }),
            commonjs({include: 'node_modules/rxjs/**'})]
    };

    return rollup(rollupConfig)
        .then(function (bundle) {
            rollUpBundle = bundle;

            return bundle.write({
                format: 'iife',
                dest: 'dist/app.js'
            });
        });
});

gulp.task('default', ['rollup'], function () {
    gulp.watch('src/**', ['rollup']);
});

and the following component

import {Component} from '@angular/core';

@Component({
    selector: 'my-app',
    templateUrl: 'app.component.html'
})
class AppComponent {

}

editing app.component.html will not change the bundle that rollup outputs.

Attached is a minimal app that reproduces the issue
rollup-angular.zip

Reproduce by running

npm install
gulp

edit app.component.html and note that the changes are not added to the app.js bundle unless you edit app.component.ts

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions