angular-hmr icon indicating copy to clipboard operation
angular-hmr copied to clipboard

Make development vs production split clear in documentation

Open akrueger opened this issue 9 years ago • 2 comments

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

akrueger avatar Aug 10 '17 14:08 akrueger

can you make a PR for the readme

PatrickJS avatar Aug 11 '17 20:08 PatrickJS

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 {}

akrueger avatar Aug 16 '17 23:08 akrueger