Closed elaijuh closed 8 years ago
don't include the loader in production and the only thing you need from this lib is bootloader
but you can remove that and bootstrap the normal way after the dom is ready
{
test: /\.ts$/,
loaders: [
'awesome-typescript-loader',
].concat(prod ? [] : '@angularclass/hmr-loader')
},
well in this way, i still have things like hrmOnInit
, hmrOnDestroy
in my source code.
I could update @angularclass/hmr-loader
to strip out the methods in prod mode that way you need to include the loader in prod. The methods won't be called at all without the loader
ok i think just let the those code in my source code, thanks
I updated the loader to allow switching to prod mode here's an example https://github.com/AngularClass/angular2-seed/blob/c139cbd9c279cd3c2864b7d9ad9f119c1d8f5b32/webpack.config.ts#L80
So definitely I don't want HMR in production running, do I need to manually check the environment and then decide if to use this module or not?
Should I do this ?