Stencil: Stencil builder cache seems to ignore changes to global scripts

Created on 10 Apr 2018  路  8Comments  路  Source: ionic-team/stencil

Stencil version:

 @stencil/[email protected]

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:

Changes in the global scripts are not picked up by the stencil compiler when serving locally (not sure about prod build).

Expected behavior:

Any change to the global script is immediately picked up

Steps to reproduce:

As per stenciljs guide, I've created 2 files src/global/index.ts & src/global/highcharts.ts. Then I've added the following property to my stencil config globalScript: 'src/global/index.ts'. The first time it worked fine.

Then I did changes to the highcharts.ts file, but nothing happened. I looked into the generated files under www/build/xxx/xxx.global.js and the code seems to be the one from before. Changes to highcharts.ts are not picked up.

If I disable the cache in stencil.config.js it works as expected, but cannot even re-enable it (still keeps using the old contents).

Related code:

// index.ts
import highcharts from './highcharts';

declare var Context: any;

Context.highcharts = highcharts;
// highcharts.ts
import Highcharts from 'highcharts';

const highcharts = Highcharts;

export default (function () {
    return highcharts;
})();
// stencil.config.js
exports.config = {
    ...
    globalScript : 'src/global/index.ts'
};

Other information:

compiler

Most helpful comment

@NorthMcCormick , did you try adding enableCache: false to the stencil config?

All 8 comments

Might be related to #575 but cannot be sure

For the record I am running into the exact same issue but I can't figure out how to even get stencil to recognize the new code. I've re-cloned my directories, cleared NPM's cache, deleted the www dir and re-built with every possible setting.

Does anyone know a way to get around this until it's fixed?

@NorthMcCormick , did you try adding enableCache: false to the stencil config?

@paulmaclean I had just come across that late last night hahaha. That does work.

For the record when re-enabled still uses the old cache. (I think this behavior is described in another related ticket, too (LOL apparently it is this ticket, it's been a week. Thank y'all))

From this ticket 馃槀

If I disable the cache in stencil.config.js it works as expected, but cannot even re-enable it (still keeps using the old contents).

Do we have any updates for this? We've been missing build caching for some time now..

Just upgraded to 0.9.7 and the issue looks resolved.

I can confirm that this seems to be resolved in 0.9.11. Works as expected even with caching enabled.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noahlaux picture noahlaux  路  3Comments

romulocintra picture romulocintra  路  3Comments

cjorasch picture cjorasch  路  3Comments

bekliev picture bekliev  路  3Comments

anthonylebrun picture anthonylebrun  路  3Comments