Buslowicz / twc

TypeScript based, boilerplate-less, Polymer toolbox friendly Polymer Modules
32 stars 1 forks source link

Wrong references generated by twc #102

Closed cbfranca closed 7 years ago

cbfranca commented 7 years ago

The generated element references a polymer by ..\..\polymer\polymer.html, but output dir is located in root of project. The correct path would be ../bower_components/polymer/polymer.html

Buslowicz commented 7 years ago

This is actually a correct reference. Generated paths are made so they would work if the component is released with bower. Once it would happen, the structure would be:

bower_components
├── my-component
│   ├── bower.json
│   └── dist
│       └── my-component.html
└── polymer
    ├── bower.json
    ├── index.html
    ├── polymer-element.html
    └── polymer.html

This means importing polymer.html would require to go from dist up to root, then up to bower_components, then into the polymer folder and from there would select the polymer.html file itself.

cbfranca commented 7 years ago

Would it be possible to make it configurable?

Buslowicz commented 7 years ago

It is configurable already :). You just need to set bowerDir environmental variable to name of bower_components folder. For example firing it (on linux and mac, not sure how to run a command with env variable set on windows) to match your expectations would be:

bowerDir=bower_components twc
tpluscode commented 7 years ago

Environment variable? bleh :P

Why isn't this a parameter of twc?

Buslowicz commented 7 years ago

This is more of a build config, and we should be able to configure different builds to different outcome (for example using bower_components on development and .. on CI). I am however open for the discussion on different approach, just need a full concept with support for different environments (CI, local dev) and build systems (cli, gulp task, custom build systems).