parcel-plugin-angular
parcel-plugin-angular copied to clipboard
Component templateUrl and styleUrls support
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:
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.