-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
excludes in JS minify being skipped #279
Comments
I thought I was going mad - I've been facing the same issue for weeks. https://stackoverflow.com/questions/50073467/ Justin - I think this is the same issue (or at least related) I asked you to take a look at (via twitter) regarding a lib (UnityLoader.js) that keeps getting screwed with in the build process (even taking the code from my custom element and incorporating in directly in my App now breaks during an ES5 build) |
FYI, I'm still experiencing this issue with a fresh install of v1.7.3. I'd be happy to submit a PR if the code ordering was seen as an acceptable fix for this issue. Please advice. |
Still the same in So for anyone who needs |
Gentle ping. Seems to be an important issue (... at least preventing me to upgrade). |
@usergenic - any chance for the cli to honor |
@usergenic - not giving up ; ) |
Exclusion still doesn't seem to work with 1.9.9. What is the status here? Is there some workaround for the time being? Or would I need to manually copy the excluded dependencies after build? |
FYI: while I was able to get by with the code suggested in #584 I was never able to get the tests to pass and never did the work upgrade the pull to the current version of the CLI. I moved away from using |
Hey everyone, thanks for your patience. I'm working on getting this in right now. |
Okay so one issue with the PR moving the bundler to after the JS transformation stuff happens is that bundler doesn't know how to bundle anything which has been transformed to AMD. While I investigate refactoring things, you might try adding the files you want to exclude to the config's {
"npm": true,
"moduleResolution": "node",
"build": [
{
"name": "bundled-es",
"bundle": {
"excludes": [ "./path/to/whatever.js" ]
},
"js": {
"minify": {
"exclude": [ "./path/to/whatever.js" ]
}
}
}
]
} |
The reason why the |
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. |
I've get a situation very close to https://github.com/Polymer/polymer-cli/issues/701 and while I've applied the approach added via Polymer/polymer-cli#952 I'm noticing that the files in question are still being minified in a way that triggers errors in the Firebase code.
Tracking through the
build
/cli
code I noticed that when the files are entering thegetOptimizeStreams
section of the build pipeline, thefile
was being tracked with a rewrittenfile.pathName
such thatfile. relative
would return an unmatchable file name when passed tonotExcluded
for comparison. The can be experienced via https://github.com/Westbrook/polymer-build-filenames which outlines the steps to see this in action.Upon further review with some help from @justinfagnani I realized that all the the JS files, no matter their origin, were being seen as
isInline === true
at https://github.com/Polymer/tools/blob/master/packages/build/src/html-splitter.ts#L189 which would clearly cause this issue. It seems be happening becausebundle
is occurring beforegetOptimizeStreams
here https://github.com/Polymer/tools/blob/master/packages/cli/src/build/build.ts#L84 It seems that this issue can be avoided by moving theif (bundled) {
block to just before theif (options.basePath) {
block here https://github.com/Polymer/tools/blob/master/packages/cli/src/build/build.ts#L128 and wanted to see if that made sense to someone more knowledgable on this project that I.I'd be happy to PR this if you'd like, though I know there is lots of dev going against this right now. Either way let me know if I can help get the right fix for this into the codebase!
The text was updated successfully, but these errors were encountered: