Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
fix(pluggable-widgets-tools): replace Windows path separator in cssUr…
Browse files Browse the repository at this point in the history
…lTransform
  • Loading branch information
tamelbrun committed Aug 23, 2022
1 parent 99b1c51 commit 6bee93f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/tools/pluggable-widgets-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- We updated `cypress` to version 10

### Fixed

- We fixed an issue which caused CSS URL transforms to include paths with backslashes when running on Windows.

## [9.13.3] - 2022-08-15

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const outAssetsDir = join(outWidgetDir, assetsDirName);
* Its main purpose to "adjust" asset path so that
* after bundling css by studio assets paths stay correct.
* Adjustment is required because of assets copying -- postcss-url can copy
* files, but final url will be relative to *destenation* file and though
* files, but final url will be relative to *destination* file and though
* will be broken after bundling by studio (pro).
*
* Example
* before: assets/icon.png
* after: com/mendix/widget/web/accordion/assets/icon.png
*/
const cssUrlTransform = asset =>
asset.url.startsWith(`${assetsDirName}/`) ? `${outWidgetDir}/${asset.url}` : asset.url;
asset.url.startsWith(`${assetsDirName}/`) ? `${outWidgetDir.replace(/\\/g, "/")}/${asset.url}` : asset.url;

export default async args => {
const production = Boolean(args.configProduction);
Expand Down

0 comments on commit 6bee93f

Please sign in to comment.