Skip to content
Snippets Groups Projects
Commit 9973a067 authored by Alexander Rose's avatar Alexander Rose
Browse files

debug mode tweaks

parent 67f7d306
No related branches found
No related tags found
No related merge requests found
...@@ -55,19 +55,9 @@ This project builds on experience from previous solutions: ...@@ -55,19 +55,9 @@ This project builds on experience from previous solutions:
### Build automatically on file save: ### Build automatically on file save:
npm run watch npm run watch
npm run watch-extra
### Build/watch mol-viewer ### With debug mode enabled:
**Build** DEBUG=molstar npm run watch
npm run build
npm run build-viewer
**Watch**
npm run watch
npm run watch-extra
npm run watch-viewer
**Run** **Run**
......
...@@ -34,6 +34,7 @@ import { StructureElementSelectionManager } from './util/structure-element-selec ...@@ -34,6 +34,7 @@ import { StructureElementSelectionManager } from './util/structure-element-selec
import { SubstructureParentHelper } from './util/substructure-parent-helper'; import { SubstructureParentHelper } from './util/substructure-parent-helper';
import { Representation } from 'mol-repr/representation'; import { Representation } from 'mol-repr/representation';
import { ModifiersKeys } from 'mol-util/input/input-observer'; import { ModifiersKeys } from 'mol-util/input/input-observer';
import { isProductionMode, isDebugMode } from 'mol-util/debug';
export class PluginContext { export class PluginContext {
private disposed = false; private disposed = false;
...@@ -225,5 +226,7 @@ export class PluginContext { ...@@ -225,5 +226,7 @@ export class PluginContext {
this.lociLabels = new LociLabelManager(this); this.lociLabels = new LociLabelManager(this);
this.log.message(`Mol* Plugin ${PLUGIN_VERSION} [${PLUGIN_VERSION_DATE.toLocaleString()}]`); this.log.message(`Mol* Plugin ${PLUGIN_VERSION} [${PLUGIN_VERSION_DATE.toLocaleString()}]`);
if (!isProductionMode) this.log.message(`Development mode enabled`);
if (isDebugMode) this.log.message(`Debug mode enabled`);
} }
} }
\ No newline at end of file
...@@ -12,8 +12,8 @@ const isProductionMode = process.env.NODE_ENV === 'production' ...@@ -12,8 +12,8 @@ const isProductionMode = process.env.NODE_ENV === 'production'
/** /**
* set to true to enable more comprehensive checks and assertions, * set to true to enable more comprehensive checks and assertions,
* moslty used in `mol-gl` * mostly used in `mol-gl`
*/ */
const isDebugMode = false const isDebugMode = process.env.DEBUG === '*' || process.env.DEBUG === 'molstar'
export { isProductionMode, isDebugMode } export { isProductionMode, isDebugMode }
\ No newline at end of file
...@@ -49,6 +49,8 @@ const sharedConfig = { ...@@ -49,6 +49,8 @@ const sharedConfig = {
}), }),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
__PLUGIN_VERSION_TIMESTAMP__: webpack.DefinePlugin.runtimeValue(() => `${new Date().valueOf()}`, true), __PLUGIN_VERSION_TIMESTAMP__: webpack.DefinePlugin.runtimeValue(() => `${new Date().valueOf()}`, true),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.DEBUG': JSON.stringify(process.env.DEBUG)
}), }),
new MiniCssExtractPlugin({ filename: 'app.css' }) new MiniCssExtractPlugin({ filename: 'app.css' })
], ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment