Skip to content

Commit bdc9ffb

Browse files
committed
fix(@angular/cli): ensure stylesheet relative tilde path conversion
1 parent f776d3c commit bdc9ffb

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

package-lock.json

+21-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"opn": "~5.1.0",
7777
"portfinder": "~1.0.12",
7878
"postcss-custom-properties": "^6.1.0",
79-
"postcss-loader": "^2.0.8",
79+
"postcss-loader": "^2.0.10",
8080
"postcss-url": "^7.1.2",
8181
"raw-loader": "^0.5.1",
8282
"resolve": "^1.1.7",

packages/@angular/cli/models/webpack-configs/styles.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
4444
const baseHref = wco.buildOptions.baseHref || '';
4545
const deployUrl = wco.buildOptions.deployUrl || '';
4646

47-
const postcssPluginCreator = function() {
47+
const postcssPluginCreator = function(loader: any) {
4848
return [
4949
postcssUrl({
5050
filter: ({ url }: { url: string }) => url.startsWith('~'),
51-
url: ({ url }: { url: string }) => path.join(projectRoot, 'node_modules', url.substr(1)),
51+
url: ({ url }: { url: string }) => {
52+
const fullPath = path.join(projectRoot, 'node_modules', url.substr(1));
53+
return path.relative(loader.context, fullPath);
54+
}
5255
}),
5356
postcssUrl([
5457
{

packages/@angular/cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"opn": "~5.1.0",
6262
"portfinder": "~1.0.12",
6363
"postcss-custom-properties": "^6.1.0",
64-
"postcss-loader": "^2.0.8",
64+
"postcss-loader": "^2.0.10",
6565
"postcss-url": "^7.1.2",
6666
"raw-loader": "^0.5.1",
6767
"resolve": "^1.1.7",

0 commit comments

Comments
 (0)