having trouble getting webpack to emit my images
up vote
1
down vote
favorite
I have a large project that I'm trying to convert to using the webpack build system. I'm close, but I'm hitting one issue.
I created a git repository to demonstrate my issue:
https://github.com/scottschafer/webpack-image-issue.git
My CSS (and LESS) use url() references like so:
body {
width: 100%;
height: 100%;
background-color: yellow;
background-image: url('/assets/images/example.png');
}
This doesn't emit the 'example.png' file, and the image fails to load.
If I manually import the image like so in my index.ts file, the file is emitted, and it's loaded:
import '@src/assets/images/example.png';
How can I fix this so that my CSS url references are automatically recognized and emitted?
webpack
add a comment |
up vote
1
down vote
favorite
I have a large project that I'm trying to convert to using the webpack build system. I'm close, but I'm hitting one issue.
I created a git repository to demonstrate my issue:
https://github.com/scottschafer/webpack-image-issue.git
My CSS (and LESS) use url() references like so:
body {
width: 100%;
height: 100%;
background-color: yellow;
background-image: url('/assets/images/example.png');
}
This doesn't emit the 'example.png' file, and the image fails to load.
If I manually import the image like so in my index.ts file, the file is emitted, and it's loaded:
import '@src/assets/images/example.png';
How can I fix this so that my CSS url references are automatically recognized and emitted?
webpack
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a large project that I'm trying to convert to using the webpack build system. I'm close, but I'm hitting one issue.
I created a git repository to demonstrate my issue:
https://github.com/scottschafer/webpack-image-issue.git
My CSS (and LESS) use url() references like so:
body {
width: 100%;
height: 100%;
background-color: yellow;
background-image: url('/assets/images/example.png');
}
This doesn't emit the 'example.png' file, and the image fails to load.
If I manually import the image like so in my index.ts file, the file is emitted, and it's loaded:
import '@src/assets/images/example.png';
How can I fix this so that my CSS url references are automatically recognized and emitted?
webpack
I have a large project that I'm trying to convert to using the webpack build system. I'm close, but I'm hitting one issue.
I created a git repository to demonstrate my issue:
https://github.com/scottschafer/webpack-image-issue.git
My CSS (and LESS) use url() references like so:
body {
width: 100%;
height: 100%;
background-color: yellow;
background-image: url('/assets/images/example.png');
}
This doesn't emit the 'example.png' file, and the image fails to load.
If I manually import the image like so in my index.ts file, the file is emitted, and it's loaded:
import '@src/assets/images/example.png';
How can I fix this so that my CSS url references are automatically recognized and emitted?
webpack
webpack
asked Nov 10 at 3:22
Scott Schafer
794
794
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235750%2fhaving-trouble-getting-webpack-to-emit-my-images%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown