Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Component templateUrl and styleUrls support #6

@bellizio

Description

@bellizio

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions