The enable-source-map Element"
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ZKConfigurationReferencePageHeader}} | {{ZKConfigurationReferencePageHeader}} | ||
− | |||
'''Syntax:''' | '''Syntax:''' | ||
Line 8: | Line 7: | ||
[Default: <code>false</code>] | [Default: <code>false</code>] | ||
− | It specifies whether to | + | 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). |
− | + | [[File:DisabledSourceMap.png|center]] | |
+ | |||
+ | When enabling it, you can open the browser developer tool to check loaded source files and help you debug. You will see <code>//# sourceMappingURL=/link-to-source-map.map</code> in a wpd file. | ||
+ | |||
+ | = ZK 8 and 9 = | ||
+ | A browser loads and shows each JavaScript widget file under <code>src</code>: | ||
+ | |||
+ | [[File:zk9SourceMap.png|center]] | ||
+ | |||
+ | (A known issue that the line number in a source file might not always match the actual running code) | ||
+ | |||
+ | = ZK 10 = | ||
+ | A browser loads and show each TypeScript widget file under <code>zk-build-utils</code>: | ||
+ | |||
+ | [[File:zk10SourceMap.png|center]] | ||
{{ZKConfigurationReferencePageFooter}} | {{ZKConfigurationReferencePageFooter}} |
Latest revision as of 06:33, 8 May 2024
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).
When enabling it, you can open the browser developer tool to check loaded source files and help you debug. You will see //# sourceMappingURL=/link-to-source-map.map
in a wpd file.
ZK 8 and 9
A browser loads and shows each JavaScript widget file under src
:
(A known issue that the line number in a source file might not always match the actual running code)
ZK 10
A browser loads and show each TypeScript widget file under zk-build-utils
: