mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In AureliaSpa, use Webpack build mode to decide whether or not to enable debug logging
This commit is contained in:
@@ -1,11 +1,14 @@
|
|||||||
import { Aurelia } from 'aurelia-framework';
|
import { Aurelia } from 'aurelia-framework';
|
||||||
import 'bootstrap/dist/css/bootstrap.css';
|
import 'bootstrap/dist/css/bootstrap.css';
|
||||||
import 'bootstrap';
|
import 'bootstrap';
|
||||||
|
declare const IS_DEV_BUILD: boolean; // The value is supplied by Webpack during the build
|
||||||
|
|
||||||
export function configure(aurelia: Aurelia) {
|
export function configure(aurelia: Aurelia) {
|
||||||
aurelia.use.standardConfiguration();
|
aurelia.use.standardConfiguration();
|
||||||
if (window.location.host.includes('localhost')) {
|
|
||||||
|
if (IS_DEV_BUILD) {
|
||||||
aurelia.use.developmentLogging();
|
aurelia.use.developmentLogging();
|
||||||
}
|
}
|
||||||
|
|
||||||
aurelia.start().then(() => aurelia.setRoot('app/components/app/app'));
|
aurelia.start().then(() => aurelia.setRoot('app/components/app/app'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({ IS_DEV_BUILD: JSON.stringify(isDevBuild) }),
|
||||||
new webpack.DllReferencePlugin({
|
new webpack.DllReferencePlugin({
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
manifest: require('./wwwroot/dist/vendor-manifest.json')
|
manifest: require('./wwwroot/dist/vendor-manifest.json')
|
||||||
|
|||||||
Reference in New Issue
Block a user