Skip to content

Commit 3fdbbd7

Browse files
adamstankiewiczmonteri
authored and
monteri
committed
fix: ensure sourceMappingUrl is correct (openedx#2352)
1 parent de56880 commit 3fdbbd7

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

build-scss.js

+10-13
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,22 @@ const compileAndWriteStyleSheets = ({
8484
}],
8585
});
8686
const commonPostCssPlugins = [
87-
postCSSCustomMedia({ preserve: true }),
8887
postCSSImport(),
88+
postCSSCustomMedia({ preserve: true }),
8989
combineSelectors({ removeDuplicatedProperties: true }),
9090
];
9191

9292
postCSS(commonPostCssPlugins)
93-
.process(compiledStyleSheet.css, { from: stylesPath, map: { inline: false } })
94-
.then(result => {
93+
.process(compiledStyleSheet.css, { from: stylesPath, map: false })
94+
.then((result) => {
9595
fs.writeFileSync(`${outDir}/${name}.css`, result.css);
96-
fs.writeFileSync(`${outDir}/${name}.css.map`, result.map.toString());
96+
97+
postCSS([postCSSMinify()])
98+
.process(result.css, { from: `${name}.css`, map: { inline: false } })
99+
.then((minifiedResult) => {
100+
fs.writeFileSync(`${outDir}/${name}.css.map`, minifiedResult.map.toString());
101+
fs.writeFileSync(`${outDir}/${name}.min.css`, minifiedResult.css);
102+
});
97103

98104
const hasExistingParagonThemeOutput = fs.existsSync(`${outDir}/${paragonThemeOutputFilename}`);
99105
let paragonThemeOutput;
@@ -118,15 +124,6 @@ const compileAndWriteStyleSheets = ({
118124
}
119125
fs.writeFileSync(`${outDir}/${paragonThemeOutputFilename}`, `${JSON.stringify(paragonThemeOutput, null, 2)}\n`);
120126
});
121-
122-
postCSS([
123-
...commonPostCssPlugins,
124-
postCSSMinify(),
125-
])
126-
.process(compiledStyleSheet.css, { from: stylesPath, map: { inline: false } })
127-
.then(result => {
128-
fs.writeFileSync(`${outDir}/${name}.min.css`, result.css);
129-
});
130127
};
131128

132129
program

styles/css/core/custom-media-breakpoints.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* IMPORTANT: This file is the result of assembling design tokens
33
* Do not edit directly
4-
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
4+
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
55
*/
66

77
@custom-media --min-pgn-size-breakpoint-xs (min-width: 0);

styles/css/core/variables.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* IMPORTANT: This file is the result of assembling design tokens
33
* Do not edit directly
4-
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
4+
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
55
*/
66

77
:root {

styles/css/themes/light/utility-classes.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* IMPORTANT: This file is the result of assembling design tokens
33
* Do not edit directly
4-
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
4+
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
55
*/
66

77
.bg-accent-a {

styles/css/themes/light/variables.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* IMPORTANT: This file is the result of assembling design tokens
33
* Do not edit directly
4-
* Generated on Sun, 04 Jun 2023 14:05:19 GMT
4+
* Generated on Sun, 04 Jun 2023 18:39:23 GMT
55
*/
66

77
:root {

0 commit comments

Comments
 (0)