Reputation: 5101
My angular CLI
works fine. getting the images as well. But still, I am getting a warning
like this:
WARNING in ./src/app/home/home.component.css
(Emitted value instead of an instance of Error) postcss-url: C:\Projects\dhl-testing\src\app\home\home.component.css:4:3: Can't read file 'C:\Projects\dhl-testing\src\app\home\assets\images\dhlmoped.jpg', ignoring
and
WARNING in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./src/styles.css
(Emitted value instead of an instance of Error) postcss-url: C:\Projects\dhl-testing\src\assets\css\sm\header.css:43:5: Can't read file 'C:\Projects\dhl-testing\src\assets\css\sm\assets\images\icon-user.png', ignoring
what are these warnings and how to fix them?
Upvotes: 15
Views: 24443
Reputation: 1403
Add '/' to the beginning of the path: example:'/assets/images/logo.png' where assets is located in the root under src Folder
Upvotes: 24
Reputation: 51
From the looks of it, you are using absolute CSS image paths
C:\Projects\dhl-testing\src\app\home\assets\images\dhlmoped.jpg
Make this relative, something like
url("\assets\images\dhlmoped.jpg")
Upvotes: -1
Reputation: 20005
In webpack.config.json
, do the following change:
"exclude": [
// instead of /\/node_modules\//
path.join(process.cwd(), 'node_modules')
]
That regex is not working properly for some reason.
(At least, this was my issue...)
Upvotes: 0