2

I am using polymer-cli's build to build my polymer app. Some of our dependencies are closed-source js libraries, which are already minified. My polymer build configuration looks like:

"builds": [{
  "name": "unbundled",
  "addServiceWorker": false,
  "addPushManifest": false,
  "insertPrefetchLinks": false,
  "js": {"minify": true, "compile": true},
  "css": {"minify": true},
  "html": {"minify": true}
}, ... ]

However, when polymer minifies the external js library code, that code breaks. So I need some way to exclude that js-code from being minified.

Any idea?

Ofisora
  • 2,707
  • 2
  • 14
  • 23
schlm3
  • 108
  • 7
  • Unfortunately I think the "correct" way is to write your own gulp build using `polymer-build`: https://github.com/Polymer/polymer-build – Jonathan Lin Oct 10 '17 at 15:09

1 Answers1

2

I believe currently there is no way to do it. The solution around it is to do an extra step to copy/overwrite from the source, to the build directory after the build process is completed.

Hope that helps!

Andrew See
  • 1,062
  • 10
  • 21
  • I ended up creating an extra assets folder (because it's no source to me), where I put this already minified 3rd party code. I then created a build step that copies this folder as is to the build directory. – Robert Aug 17 '18 at 15:04