Skip to content

Commit

Permalink
#131: transpiles relative import paths incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Busłowicz committed Dec 22, 2017
1 parent 68bd4bf commit 63865bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export class Import {
return `<script src="${this.resolveModule()}"></script>`;
case ".css":
return `<link rel="stylesheet" href="${this.resolveModule()}">`;
case ".html":
return `<link rel="import" href="${this.resolveModule()}">`;
default:
return `<link rel="import" href="${this.resolveModule(".html")}">`;
}
Expand Down
6 changes: 6 additions & 0 deletions tests/targets/polymer1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ describe("Polymer v1 output", () => {
expect(transpile(`import './path/script.js';`).es5)
.to.equal(`<script src="./path/script.js"></script>\n`);

expect(transpile(`import './path/style.css';`).es5)
.to.equal(`<link rel="stylesheet" href="./path/style.css">\n`);

expect(transpile(`import './path/component.html';`).es5)
.to.equal(`<link rel="import" href="./path/component.html">\n`);

expect(transpile(`import "./module";`).es5)
.to.equal(`<link rel="import" href="./module.html">\n`);

Expand Down

0 comments on commit 63865bd

Please sign in to comment.