generator-angular2-library icon indicating copy to clipboard operation
generator-angular2-library copied to clipboard

Fix/tsconfig playground paths

Open izifortune opened this issue 7 years ago • 8 comments

Some rework around the playground removing the need to compile the main library. Please test it out

izifortune avatar Jan 27 '18 12:01 izifortune

@izifortune This looks awesome. Have you been able to test it yet with different libraries?

Great work!! 🏆

jvandemo avatar Feb 04 '18 22:02 jvandemo

@jvandemo didn't have the time to go to through a full test. I will try to put some time on it this week

izifortune avatar Feb 06 '18 21:02 izifortune

@izifortune — Thank you, much appreciated! 🏆

jvandemo avatar Feb 06 '18 22:02 jvandemo

Hi,

I made changes but I have problem with html files in my components. For example: Failed to load resource: the server responded with a status of 404 (Not Found)

http://localhost:3000/spinner.component.html

Do you have idea why?

kkozlowski89 avatar Feb 08 '18 15:02 kkozlowski89

If I use component like it - it works fine.

import { Component } from '@angular/core';

@Component({
  selector: 'sample-component',
  template: `<h1>Sample component2</h1>`
})
export class SampleComponent {

  constructor() {
      console.log("hello world!!");
  }

}

but when I change template to templateUrl for example

import { Component } from '@angular/core';

@Component({
  selector: 'sample-component',
  templateUrl: './sample.component.html'
})
export class SampleComponent {

  constructor() {
      console.log("hello world!!");
  }

}

I have as I wrote in previous comment:

Failed to load resource: the server responded with a status of 404 (Not Found)

http://localhost:3000/sample.component.html

kkozlowski89 avatar Feb 08 '18 18:02 kkozlowski89

I had a look into this, the problem is that all the html are not copied there. if i try to copy them inside .playground/src they will not be found anyway because the components are asking those html files regarding to the root /sample.component.html.

There should be some way with browser sync to manage this, or we might have a look to inline templates as part of the playground:build.

Any suggestions?

izifortune avatar Feb 20 '18 22:02 izifortune

If you set absolute path it works like: src/sample.component.html

But whole solution is not perfect because for example if someone use sass for css - files are not compiled during playground... it is other problem.

kkozlowski89 avatar Feb 21 '18 07:02 kkozlowski89

Meaning we need a proper build to get all the cases covered

izifortune avatar Feb 21 '18 10:02 izifortune