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

Make development vs production split clear in documentation #67

Open
akrueger opened this issue Aug 10, 2017 · 2 comments
Open

Make development vs production split clear in documentation #67

akrueger opened this issue Aug 10, 2017 · 2 comments

Comments

@akrueger
Copy link

Hi, thanks for the great work.

Is it possible to update the documentation to have more clear division about using the library in different environments. It seems that running HMR in development is the happy path. I can't seem to find a straightforward way to split the code path when running in development vs production.

e.g. in this ng-cli example, I see a clear distinction:

https://github.com/jschwarty/angularcli-hmr-example/blob/master/src/main.ts

@PatrickJS
Copy link
Owner

can you make a PR for the readme

@akrueger
Copy link
Author

I would be happy to, but unfortunately I haven't managed to get the library to work with my Webpack build. I'm not using ngRx yet (although I plan to) and it's not clear to me if this library will work without a store based on what I see in the MainModule class.

Will it work without ngRx ?

I have main.ts:

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
import { enableProdMode } from '@angular/core'

import { AppModule } from './app/app.module'

if (process.env.ENV === 'production') {
  enableProdMode()
}

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .then(success => console.log('Bootstrap success'))
  .catch(error => console.error(error))

and app.component.ts

import { Component } from '@angular/core'

// Master styles
import '../assets/styles/global_styles.scss'

@Component({
  selector: 'portal-app',
  templateUrl: './app.component.html'
})
export class AppComponent {}

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