Skip to content

Commit

Permalink
Merge pull request #31 from vania-pooh/master
Browse files Browse the repository at this point in the history
Correctly rendering images from CSS
  • Loading branch information
vania-pooh authored Aug 28, 2019
2 parents cca2552 + aa2f64a commit 86130b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/css/imports/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ html, body {
}

.background {
background-image: url('/images/background.svg');
background-image: url('#{$prefix}/images/background.svg');
background-size: cover;
background-position: center 100px;
background-repeat: no-repeat;
Expand Down Expand Up @@ -52,7 +52,7 @@ a, a:hover {

&:after {
content: "";
background-image: url('/images/dropdown.svg');
background-image: url('#{$prefix}/images/dropdown.svg');
position: absolute;
right: 16px;
top: 27.5px;
Expand Down
9 changes: 8 additions & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ module.exports = {
{
test: /\.(sa|sc|c)ss$/,
exclude: /node_modules/,
use: ["style-loader", MiniCssExtractPlugin.loader, "css-loader", "postcss-loader", "sass-loader"]
use: [
"style-loader", MiniCssExtractPlugin.loader, "css-loader", "postcss-loader",
{
loader: "sass-loader",
options: {
data: "$prefix: \"" + (process.env.NODE_ENV === "production" ? "/moon" : "") + "\";"
}
}]
}
]
},
Expand Down

0 comments on commit 86130b6

Please sign in to comment.