Closed NicolaiSchmid closed 6 years ago
I also experience the same issue. Any suggestions?
Actually I have. I'm still using the same polymer.json
build configuration from above, in my index.html
I set the base tag: <base href="/">
(the newer versions of Polymer-starter-kit do this as well). All of the HTML imports are relative to the project root.
In index.html
like this:
<script src="bower_components/webcomponentsjs/webcomponents-loader.js" async></script>
In src/my-app.html
:
<link rel="import" href="../bower_components/polymer/polymer-element.html">
You get the point... And for the express server, I use this code:
const prpl = require('prpl-server');
const express = require('express');
const config = require('./build/polymer.json');
const app = express();
app.get('/*', prpl.makeHandler('./build/', config));
app.listen(process.env.PORT || 80);
Hey, I'm trying to setup a dynamic server, which serves 4 different builds generated from the polymer-cli.
I'm using the
basePath
option in the config for correctly importing all HTML Imports, but when I try to load mylocales.json
file for i18n andAppLocalizeBehavior
I get an error because the base tag is not respected by JS. Same goes with iron-ajax elements, which make requests in JS with XHR. Do you have any ideas, how I could solve this problem, preferably without rewriting all paths in my application? Thank You!my
polymer.json
builds array: