Description
Please provide us with the following information:
OS?
OSX Sierra
Versions.
@angular/cli: 1.0.0-beta.32
node: 7.3.0
os: darwin x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-beta.32
@angular/compiler-cli: 2.4.8
Repro steps.
- ng new test
- cd test
- ng g component test
- mv src/app/test/test.component.css src/app/test/test.component.less
- edit src/app/test/test.component.ts to reference the less file instead of css
- put an image file (I used sample.svg) into the src/assets folder.
- Put the following in src/app/test/test.component.less
.nothing {
background: url("assets/sample.svg");
}
- ng build
The log given by the failure.
ERROR in ./src/app/test/test.component.less
Module not found: Error: Can't resolve './assets/sample.svg' in'/Users/lyrael/test/src/app/test'
@ ./src/app/test/test.component.less 6:60-90
@ ./src/app/test/test.component.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
Mention any other details that might be useful.
This exact setup worked fine in beta.30 but did not in .32 .
Note that the CSS specifies "assets/sample.svg" but the error says "./assets/sample.svg". I suspect something in the new version is "fixing" (i.e. breaking) my URL path.