Open eavichay opened 6 years ago
use nohoist to get everything into the local directory when needed. In local dev toss this in a script tag b4 the type modules
const _customElementsDefine = window.customElements.define;
window.customElements.define = (name, cl, conf) => {
if (!customElements.get(name)) {
_customElementsDefine.call(window.customElements, name, cl, conf);
}
else {
console.warn(`${name} has been defined twice`);
}
};
project package.json points the library to local filesystem, no install or download via npm resgistry. Will the polymer server add something like modules-middleware in order to solve this?
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.
Description
I have a mono-repo project, with two polymer-based projects (one is library, the other is the main project) The folder structure:
All the node_modules are in the shared node_modules folder, collected by yarn workspaces monorepo approach.
The polymer server cannot find node_modules in the project's directory and probably should fall back just like node does to an upper directory, until found? This cannot be resolved using specific import paths as the "root" server folder is in the package folder and cannot go to an upper directory.
Versions & Environment
Steps to Reproduce
yarn workspaces + monorepo project under packages two projects using same @polymer/polymer@3+ version
run
polymer serve
orpolymer test
in any of them - server fails to locate the node_modules.Expected Results
polymer server to traverse up until node_modules with the library is found
Actual Results
404 Not Found