Skip to content

Production build service problem #953

@petoknm

Description

@petoknm

I am trying to use a generated service in the main component. When I try to use a generated service in dev environment everything is fine. But when I switch to production is cannot find the service => GET http://localhost:4200/app/flights.service.js 404 (Not Found). The service is not present in the dist folder. Am I doing something wrong? Build is successful but for some reason the service is not there. If it is being bundled into index.js then it should not be requested from flights.service.js, right?

OS: Linux x64, Fedora 23
ng-cli : 1.0.0-beta.5
node: 5.11.1

Reproduction Steps:
Generate a new app using ng new ng-app
Generate a new service using ng g service flights
Then use the service in the app by adding it to the bootstrap list of dependencies and injecting it into the main component.
Serve it in production mode ng serve -prod
Load the app in the browser => GET http://localhost:4200/app/flights.service.js 404 (Not Found)

The app that shows the problem: https://github.com/petoknm/angular2-cli-issue
screenshot from 2016-05-29 10-40-52
screenshot from 2016-05-29 10-41-45

Thank you 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions