Skip to content

Commit

Permalink
fix: ensure sourceMappingUrl is correct (#2352)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz authored and PKulkoRaccoonGang committed Aug 1, 2024
1 parent 0352d37 commit 196ed40
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
23 changes: 10 additions & 13 deletions build-scss.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,22 @@ const compileAndWriteStyleSheets = ({
}],
});
const commonPostCssPlugins = [
postCSSCustomMedia({ preserve: true }),
postCSSImport(),
postCSSCustomMedia({ preserve: true }),
combineSelectors({ removeDuplicatedProperties: true }),
];

postCSS(commonPostCssPlugins)
.process(compiledStyleSheet.css, { from: stylesPath, map: { inline: false } })
.then(result => {
.process(compiledStyleSheet.css, { from: stylesPath, map: false })
.then((result) => {
fs.writeFileSync(`${outDir}/${name}.css`, result.css);
fs.writeFileSync(`${outDir}/${name}.css.map`, result.map.toString());

postCSS([postCSSMinify()])
.process(result.css, { from: `${name}.css`, map: { inline: false } })
.then((minifiedResult) => {
fs.writeFileSync(`${outDir}/${name}.css.map`, minifiedResult.map.toString());
fs.writeFileSync(`${outDir}/${name}.min.css`, minifiedResult.css);
});

const hasExistingParagonThemeOutput = fs.existsSync(`${outDir}/${paragonThemeOutputFilename}`);
let paragonThemeOutput;
Expand All @@ -118,15 +124,6 @@ const compileAndWriteStyleSheets = ({
}
fs.writeFileSync(`${outDir}/${paragonThemeOutputFilename}`, `${JSON.stringify(paragonThemeOutput, null, 2)}\n`);
});

postCSS([
...commonPostCssPlugins,
postCSSMinify(),
])
.process(compiledStyleSheet.css, { from: stylesPath, map: { inline: false } })
.then(result => {
fs.writeFileSync(`${outDir}/${name}.min.css`, result.css);
});
};

program
Expand Down
2 changes: 1 addition & 1 deletion styles/css/core/custom-media-breakpoints.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* IMPORTANT: This file is the result of assembling design tokens
* Do not edit directly
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
*/

@custom-media --min-pgn-size-breakpoint-xs (min-width: 0);
Expand Down
2 changes: 1 addition & 1 deletion styles/css/core/variables.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* IMPORTANT: This file is the result of assembling design tokens
* Do not edit directly
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
*/

:root {
Expand Down
2 changes: 1 addition & 1 deletion styles/css/themes/light/utility-classes.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* IMPORTANT: This file is the result of assembling design tokens
* Do not edit directly
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
*/

.bg-accent-a {
Expand Down
2 changes: 1 addition & 1 deletion styles/css/themes/light/variables.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* IMPORTANT: This file is the result of assembling design tokens
* Do not edit directly
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
*/

:root {
Expand Down

0 comments on commit 196ed40

Please sign in to comment.