Polymer / tools

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

custom-elements-es5-adapter not being built with es5-bundle but works with es6-bundle #2544

Open exp0nge opened 6 years ago

exp0nge commented 6 years ago

Description

Similar to Polymer/polymer-cli/pull/817, Polymer/polymer-cli/issues/634

custom-elements-es5-adapter.js builds for es6-bundled but not for es5-bundled. The index.html for es6 uses webcomponents-loader.js while the es5 bundle requires the custom-elements adapter which is not built.

Versions & Environment

Steps to Reproduce

Unfortunately I cannot give the source code for this project.

Expected Results

es5-bundled builds custom-elements-es5-adapter.js

Actual Results

custom-elements-es5-adapter is not built but is injected into index.html

johnthad commented 6 years ago

I am having this same problem with polymer-cli 1.5.7, Node 8.9.1, and MacOS 10.10.5 and 11.13.1. Additionally, webcomponents-loader.js is not being copied to either es5-bundled or es6-bundled. My polymer.json is

"extraDependencies": [
  "manifest.json",
  "client/bower_components/webcomponentsjs/*.js",
  "client/node_modules/redux/dist/redux.js",
  "client/node_modules/redux-thunk/dist/redux-thunk.js"
],

Nor will the files copy if I drop the .js (see https://stackoverflow.com/q/47086800/1316011). As a result, I use an NPM script copy the files in after polymer build runs.

rjcorwin commented 6 years ago

To @johnthad's point, my npm build target now looks like...

"build": "./node_modules/.bin/polymer build && mkdir build/es5-bundled/node_modules && cp -r node_modules/@webcomponents build/es5-bundled/node_modules"
rjcorwin commented 6 years ago

I'm in Polymer 3 world, sounds like the other comments were coming from Polymer 2. For anyone running into this issue in Polymer 3, see here for a better solution.

stale[bot] commented 4 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.