Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Ignore remote files during build #16

Merged
merged 1 commit into from
Aug 1, 2016
Merged

Conversation

FredKSchott
Copy link
Contributor

Fixes #10

/cc @justinfagnani @filipproch

* in the browser.
*/
function isDependencyRemote(url: string) {
return urlParse(url).protocol !== null || url.startsWith('//');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"remote" should include URLs on the same host that are outside the application root, but first we need to add support for application roots. Can you add a TODO here for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good call. Yea that's a much more complicated issue, I'll add the TODO.

@justinfagnani
Copy link
Contributor

LGTM with small comments

@FredKSchott FredKSchott merged commit da0c799 into master Aug 1, 2016
@FredKSchott FredKSchott deleted the ignore-remote-files branch August 1, 2016 22:06
@jpincas
Copy link

jpincas commented Mar 6, 2017

Is this working?

function isDependencyExternal(url: string) {
  // TODO(fks) 08-01-2016: Add additional check for files on current hostname
  // but external to this application root. Ignore them.
  return parseUrl(url).protocol !== null || url.startsWith('//');
}

Once of my imports is:

<link rel="import" href="http://localhost:3000/admin-panel/polymer-imports.html">

and it is causing a build error. Doesn't seem to matter whether I start the href with the protocol or '//'.

@jpincas
Copy link

jpincas commented Mar 6, 2017

OK - looking through the code a bit more closely I can see that ignoring external dependencies only applies to script and style dependencies. Is there a particular reason for this? I am importing a dynamically rendered html file from an external server which contains a lot of setup information as behaviors. It works perfectly with 'polymer serve' and seems like a good architecture. Is it unwise for some reason?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants