In AureliaSpa, use Webpack build mode to decide whether or not to enable debug logging

This commit is contained in:
SteveSandersonMS
2016-10-28 15:27:54 +01:00
parent bd86026bb9
commit 4b507004b1
2 changed files with 5 additions and 1 deletions

View File

@@ -1,11 +1,14 @@
import { Aurelia } from 'aurelia-framework';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap';
declare const IS_DEV_BUILD: boolean; // The value is supplied by Webpack during the build
export function configure(aurelia: Aurelia) {
aurelia.use.standardConfiguration();
if (window.location.host.includes('localhost')) {
if (IS_DEV_BUILD) {
aurelia.use.developmentLogging();
}
aurelia.start().then(() => aurelia.setRoot('app/components/app/app'));
}

View File

@@ -21,6 +21,7 @@ module.exports = {
]
},
plugins: [
new webpack.DefinePlugin({ IS_DEV_BUILD: JSON.stringify(isDevBuild) }),
new webpack.DllReferencePlugin({
context: __dirname,
manifest: require('./wwwroot/dist/vendor-manifest.json')