Skip to content

Commit 1f942b6

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

File tree

1 file changed

+5
-2
lines changed
  • packages/@angular/cli/models/webpack-configs

1 file changed

+5
-2
lines changed

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
{

0 commit comments

Comments
 (0)