Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using bundled js #44

Closed
abishek opened this issue Sep 9, 2016 · 3 comments
Closed

using bundled js #44

abishek opened this issue Sep 9, 2016 · 3 comments

Comments

@abishek
Copy link

abishek commented Sep 9, 2016

When I try to run lite-server with dist/bundle.js I get this error.

zone.js:101 GET http://localhost:3000/app/customer/customer.module 404 (Not Found)

My index.html looks like this:

`
...

<script src="node_modules/core-js/client/shim.min.js"></script>

<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
....

index.html.zip

<!-- add for bundle usage -->
<script src="dist/bundle.js"></script>
<!-- add for bundle usage -->
`

How do I proceed?

@abishek
Copy link
Author

abishek commented Sep 9, 2016

I got this far, but not sure I understand how to get further.

<!-- add for bundle usage --> <script src="dist/bundle.js"></script> <!-- add for bundle usage --> <script> System.config({ packages: { '@angular': { defaultExtension: false, }, 'app': {defaultExtension: 'js'}, 'rxjs': {defaultExtension: 'js'} }, }); </script>

I think by doing this, am not using the bundle.js for loading the app. Or am running down the wrong road.

404_errors

@abishek
Copy link
Author

abishek commented Sep 9, 2016

Ok, I may have found the issue by some brute forcing :(

The npm run bundle command seems to omit the customer/* components when it bundles. Is that possible? How does this inference actually work?

@DanWahlin
Copy link
Owner

I don't think I'm going to put any additional work into the bundling at this point given the release of AOT. Want to eventually move to that with tree shaking: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants