Skip to content

Commit

Permalink
generate source maps to ease debugging CSS/ JS
Browse files Browse the repository at this point in the history
  • Loading branch information
bratkartoffel committed Jan 19, 2023
1 parent 156fd4f commit 0c67035
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- generate source maps to ease debugging CSS/ JS

### Fixed

- (cron) fix now base production for kiwi's
Expand Down
6 changes: 4 additions & 2 deletions development/watchers.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<TaskOptions>
<TaskOptions>
<option name="arguments" value="--compilation_level SIMPLE_OPTIMIZATIONS --js $FileName$"/>
<option name="arguments"
value="--compilation_level SIMPLE_OPTIMIZATIONS --js $FileName$ --create_source_map $FileNameWithoutExtension$.js.map"/>
<option name="checkSyntaxErrors" value="true"/>
<option name="description"/>
<option name="exitCodeBehavior" value="ERROR"/>
Expand All @@ -20,7 +21,8 @@
<envs/>
</TaskOptions>
<TaskOptions>
<option name="arguments" value="-i $FileName$ -o $FileNameWithoutExtension$.min.css --no-restructure --stat"/>
<option name="arguments"
value="--input $FileName$ --output $FileNameWithoutExtension$.min.css --source-map $FileNameWithoutExtension$.css.map --no-restructure"/>
<option name="checkSyntaxErrors" value="true"/>
<option name="description"/>
<option name="exitCodeBehavior" value="ERROR"/>
Expand Down
6 changes: 0 additions & 6 deletions include/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1660,19 +1660,13 @@ function sendCspHeader(): void
function printHeaderCss(array $styles): void
{
foreach ($styles as $style) {
if (Config::getBoolean(Config::SECTION_BASE, 'testing')) {
$style = str_replace('.min.', '.', $style);
}
printf('<link rel="stylesheet" type="text/css" href="%s?%s" nonce="%s"/>' . "\n", $style, game_version, getCspNonce());
}
}

function printHeaderJs(array $scripts): void
{
foreach ($scripts as $script) {
if (Config::getBoolean(Config::SECTION_BASE, 'testing')) {
$script = str_replace('.min.', '.', $script);
}
printf('<script src="%s?%s" nonce="%s"></script>' . "\n", $script, game_version, getCspNonce());
}
}
Expand Down
5 changes: 5 additions & 0 deletions js/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<IfModule mod_headers.c>
<Files functions.min.js>
Header set SourceMap functions.js.map
</Files>
</IfModule>
8 changes: 8 additions & 0 deletions js/functions.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions styles/admin.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion styles/admin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions styles/mobile.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion styles/mobile.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions styles/style.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit 0c67035

Please sign in to comment.