Polymer / pwa-starter-kit

Starter templates for building full-featured Progressive Web Apps from web components.
https://pwa-starter-kit.polymer-project.org
2.36k stars 431 forks source link

One file listed in extraDependencies is not being copied over to built -- why? #369

Closed mercmobily closed 5 years ago

mercmobily commented 5 years ago

[UPDATE: there is only actually one problem]

I need a bunch of external Javascript libraries in my application. At the moment, I am doing this:

In index.html I have:

    <!-- JS libraries -->
    <script src="node_modules/moment/min/moment-with-locales.min.js"></script>
    <script src="node_modules/moment-timezone/builds/moment-timezone-with-data.js"></script>
    <script src="node_modules/moment-precise-range-plugin/moment-precise-range.js"></script>
    <script src="node_modules/sortablejs/Sortable.min.js"></script>
    <script src="node_modules/ejs/ejs.min.js"></script>
    <script src="node_modules/datalist-polyfill/datalist-polyfill.min.js"></script>
    <script src="src/components/lib/Utils.js"></script>

I then added them as extraDependencies in my polymer.json:

  "extraDependencies": [
    "manifest.json",
    "node_modules/@webcomponents/webcomponentsjs/**",
    "push-manifest.json",
    "node_modules/moment/min/moment-with-locales.min.js",
    "node_modules/moment-timezone/builds/moment-timezone-with-data.js",
    "node_modules/moment-precise-range-plugin/moment-precise-range.js",
    "node_modules/sortablejs/Sortable.min.js",
    "node_modules/ejs/ejs.min.js",
    "node_modules/datalist-polyfill/datalist-polyfill.min.js",
    "src/components/lib/Utils.js"
  ],

However, the result directory 'build' contains all of the required extra files, does NOT have Utils.js in its right spot.

I was under the impression that files listed in extraDependencies were supposed to be left as "stand alone" files. However, it doesn't seem to be the case for Utils.js.

I realise that it's a bit weird, needing that as an external file... but I do.

mercmobily commented 5 years ago

Self answer: one of my views importedUtils.js; for whatever reason, if ONE view imports a file, even if it's listed as a dependency, it won't be copied over!