parcel-plugin-angular icon indicating copy to clipboard operation
parcel-plugin-angular copied to clipboard

Component templateUrl and styleUrls support

Open bellizio opened this issue 6 years ago • 0 comments

Given the following component code:

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

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'Angular Parcel Starter';
}

After running the following production build script: parcel build ./src/index.html --public-url ./

The code inside the html and scss files referenced in the component meta data is not inlined in the production js bundle code.

Here is a snippet of the production bundle: screenshot 2018-03-22 14 57 19

As a result, 404s are returned when running the production build on a server (since the files are not copied over either): "GET /app.component.html" Error (404): "Not found"

Also, running the parcel development command with templateUrl and styleUrls in a component does not work either - the app hangs and eventually throws ERROR RangeError: Maximum call stack size exceeded in the browser console.

bellizio avatar Mar 22 '18 19:03 bellizio