PolymerElements / iron-ajax

Easily make ajax requests
https://www.webcomponents.org/element/PolymerElements/iron-ajax
127 stars 113 forks source link

Import path are not relatives #321

Closed jehon closed 6 years ago

jehon commented 6 years ago

Description

In iron-ajax.js, the dependancies should start with "./"

import { Base } from '@polymer/polymer/polymer-legacy.js';
import './iron-request.js';
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js';

To

import { Base } from '../polymer/polymer-legacy.js';
import './iron-request.js';
import { Polymer } from '../polymer/lib/legacy/polymer-fn.js';

Reason: I would expect the module to works out of the box in chrome, event on a simple apache server.

Thanks for this great product

Browsers Affected

e111077 commented 6 years ago

Hello, due to the node_modules folder not being automatically flat, we have decided to use bare module specifiers instead of full paths. If you use the polymer cli's server (or the polymer/tools's polyserve node interface) then you should be able to get name-to-path resolution. (polymer serve --npm --module-resolution node see polymer help serve for more info) We are trying our best to get this standardized so that you can run this straight from the browser. See:

https://github.com/domenic/package-name-maps

Otherwise, you can use the polymer build tool to compile the paths and output