Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Polymer not building any bower_components #2285

Open ghost opened 7 years ago

ghost commented 7 years ago

When running polymer build none of the bower components are being included in the build.

MacOS - 10.12.1
npm -v; node -v; polymer --version
3.10.8
v6.9.1
0.17.0
$ polymer build --verbose
debug:   got args: 
{ args: [ 'build', '--verbose' ] }
debug:   got default config from file: 
{ config: 
   { entrypoint: 'index.html',
     shell: '/src/my-app.html',
     fragments: 
      [ '/src/pages/my-dashboard.html',
        '/src/pages/my-detail.html',
        '/src/pages/my-docs.html',
        '/src/pages/my-editor.html',
        '/src/pages/my-login.html',
        '/src/pages/my-packageslist.html',
        '/src/pages/my-packages.html',
        '/src/pages/my-view403.html',
        '/src/pages/my-view404.html',
        '/src/pages/my-loading.html' ],
     sources: [ 'bower.json' ] } }
debug:   adding command build
debug:   adding command help
debug:   adding command init
debug:   adding command lint
debug:   adding command serve
debug:   adding command test
debug:   running...
debug:   command 'build' found, parsing command args: 
{ args: [ '--verbose' ] }
debug:   command options parsed from args: 
{ 'sw-precache-config': 'sw-precache-config.js', verbose: true }
debug:   final project configuration generated: 
{ root: '/Users/dale/Desktop/forms-site-app',
  sourceGlobs: [ 'bower.json' ],
  includeDependencies: undefined,
  entrypoint: '/Users/dale/Desktop/forms-site-app/index.html',
  shell: '/src/my-app.html',
  fragments: 
   [ '/src/pages/my-dashboard.html',
     '/src/pages/my-detail.html',
     '/src/pages/my-docs.html',
     '/src/pages/my-editor.html',
     '/src/pages/my-login.html',
     '/src/pages/my-packageslist.html',
     '/src/pages/my-packages.html',
     '/src/pages/my-view403.html',
     '/src/pages/my-view404.html',
     '/src/pages/my-loading.html' ],
  inputs: 
   [ '/Users/dale/Desktop/forms-site-app/index.html',
     '/src/my-app.html',
     '/src/pages/my-dashboard.html',
     '/src/pages/my-detail.html',
     '/src/pages/my-docs.html',
     '/src/pages/my-editor.html',
     '/src/pages/my-login.html',
     '/src/pages/my-packageslist.html',
     '/src/pages/my-packages.html',
     '/src/pages/my-view403.html',
     '/src/pages/my-view404.html',
     '/src/pages/my-loading.html' ] }
debug:   Running command...
debug:   building with options 
{ swPrecacheConfig: 'sw-precache-config.js',
  insertDependencyLinks: undefined,
  html: {},
  css: {},
  js: {} }
debug:   building via standard build()...
debug:   sourceGlobs: 
    /Users/dale/Desktop/forms-site-app/index.html
    /src/my-app.html
    /src/pages/my-dashboard.html
    /src/pages/my-detail.html
    /src/pages/my-docs.html
    /src/pages/my-editor.html
    /src/pages/my-login.html
    /src/pages/my-packageslist.html
    /src/pages/my-packages.html
    /src/pages/my-view403.html
    /src/pages/my-view404.html
    /src/pages/my-loading.html
    /Users/dale/Desktop/forms-site-app/bower.json
debug:   root: /Users/dale/Desktop/forms-site-app
debug:   shell: /src/my-app.html
debug:   entrypoint: /Users/dale/Desktop/forms-site-app/index.html
debug:   fragments: /src/pages/my-dashboard.html,/src/pages/my-detail.html,/src/pages/my-docs.html,/src/pages/my-editor.html,/src/pages/my-login.html,/src/pages/my-packageslist.html,/src/pages/my-packages.html,/src/pages/my-view403.html,/src/pages/my-view404.html,/src/pages/my-loading.html
debug:   sources: /Users/dale/Desktop/forms-site-app/bower.json
debug:   includeDependencies: 
info:    Preparing build...
info:    Building application...
debug:   Reading source files...
debug:   sourceGlobs: 
    /Users/dale/Desktop/forms-site-app/index.html
    /src/my-app.html
    /src/pages/my-dashboard.html
    /src/pages/my-detail.html
    /src/pages/my-docs.html
    /src/pages/my-editor.html
    /src/pages/my-login.html
    /src/pages/my-packageslist.html
    /src/pages/my-packages.html
    /src/pages/my-view403.html
    /src/pages/my-view404.html
    /src/pages/my-loading.html
    /Users/dale/Desktop/forms-site-app/bower.json
debug:   Reading dependencies...
debug:   Service worker config found 
{ staticFileGlobs: 
   [ '/index.html',
     '/manifest.json',
     '/bower_components/webcomponentsjs/webcomponents-lite.min.js' ],
  navigateFallback: '/index.html' }
debug:   Analyzing build dependencies...
debug:   addFile: /Users/dale/Desktop/forms-site-app/index.html
info:    Generating build/unbundled...
info:    Generating build/bundled...
debug:   addFile: /Users/dale/Desktop/forms-site-app/bower.json

After changing the links to form /src/path to src/path the components but no longer get the my-app.html file in the bundled section but its there in the unbundled section.

web-padawan commented 7 years ago

You are missing globs, see docs for explanation and also example from README:

  "sources": [
    "src/**/*",
    "images/**/*",
    "bower.json"
  ],
atishpatel commented 7 years ago

I also had an issue where an old project of mine stopped working on certain browsers because the new polymer build command didn't copy over webcomponentsjs.

Could we make it so polymer.json is considered invalid if any of any of the following are missing? entrypoint, shell, fragments,sources, includeDependencies

FredKSchott commented 7 years ago

entrypoint, shell, fragments,and includeDependencies are not required for all projects. polymer.json isn't even required for all projects :)

sources is a bit tricky if you're not using a src/ directory in your project. If we decide to make polymer.json required for everything, then maybe we could get rid of this default and force the user to define their sources.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.