The enable-source-map Element"

From Documentation
Line 1: Line 1:
 
{{ZKConfigurationReferencePageHeader}}
 
{{ZKConfigurationReferencePageHeader}}
  
{{versionSince| 10.0.0}}
 
  
 
'''Syntax:'''
 
'''Syntax:'''
Line 8: Line 7:
 
  [Default: <code>false</code>]
 
  [Default: <code>false</code>]
  
It specifies whether to using source map to debug JavaScript files. By default, it is <code>false</code> and ZK loads <code>*.wpd</code>, the merged JavaScript files of the same package. Those files are roughly categorized by package (e.g. zk.wpd or zkbind.wpd).
+
It specifies whether to produce source map links for browsers to load the JavaScript/TypeScript source. By default, ZK only loads <code>*.wpd</code>, the merged JavaScript files of the same package. One wpd file contains multiple JavaScript files. Those files are merged upon JavaScript widget packages (e.g. zk.wpd or zkbind.wpd).
  
To debug JavaScript files with more precise directories and files, you can specify it to <code>true</code>. Then, we can locate the JavaScript (TypeScript after ZK 10.0.0) files easily.
+
[[File:DisabledSourceMap.png|center]]
 +
 
 +
When enabling it, you can open the browser developer tool to check loaded source files and help you debug.
 +
 
 +
= ZK 8 and 9 =
 +
A browser loads and show each JavaScript widget file under <code>src</code>:
 +
 
 +
[[File:zk9SourceMap.png|center]]
 +
 
 +
= ZK 10 =
 +
A browser loads and show each TypeScript widget file under <code>zk-build-utils</code>:
 +
 
 +
[[File:zk10SourceMap.png|center]]
  
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Revision as of 06:03, 8 May 2024


The enable-source-map Element



Syntax:

<enable-source-map>true|false</enable-source-map>
[Default: false]

It specifies whether to produce source map links for browsers to load the JavaScript/TypeScript source. By default, ZK only loads *.wpd, the merged JavaScript files of the same package. One wpd file contains multiple JavaScript files. Those files are merged upon JavaScript widget packages (e.g. zk.wpd or zkbind.wpd).

DisabledSourceMap.png

When enabling it, you can open the browser developer tool to check loaded source files and help you debug.

ZK 8 and 9

A browser loads and show each JavaScript widget file under src:

Zk9SourceMap.png

ZK 10

A browser loads and show each TypeScript widget file under zk-build-utils:

Zk10SourceMap.png



Last Update : 2024/05/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.