Having issues with `copy` and relative path to `to`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start by reproducing the reported Rollup configuration with postcss-url, including the relative to, extract, and assetsPath values, and inspect how the copied asset path is generated. Done means the image remains in public/dist and the generated CSS references it as /dist/<hash>.jpg or a same-directory relative path.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey so I have the following config (in rollup):
postcss({
to: './public/dist/',
extract: 'public/dist/app.css',
plugins: [
url({
url: 'copy',
useHash: true,
assetsPath: './dist/',
})
]
})
And the following CSS:
.hero {
background-image: url("../images/hero.jpg");
}
Which is the closest I can get it to working, the image is in the right directory public/dist however the CSS path is background-image: url("dist/7d8c51c4.jpg");
This resolves to http://localhost/dist/dist/7d8c51c4.jpg as opposed to http://localhost/dist/7d8c51c4.jpg.
I am running a server in the public/ directory and essentially need the path to be /dist/7d8c51c4.jpg or alternatively ./7d8c51c4.jpg as the image is in the same root as the generated CSS file.
I have tried every possible variation I can think of with the to and assetPath arguments, but I either get the path right and the image in the wrong directory or the image in the right directory and the wrong path.
Cheers.
- Ngôn ngữ chính
- JavaScript
- Star
- 383
- Fork
- 58
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của postcss/postcss-url
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
postcss/postcss-url#183 · 1 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
postcss/postcss-url#182 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
postcss/postcss-url#181 · 1 reaction ·
-
postcss-import integrationĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
postcss/postcss-url#180 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
postcss/postcss-url#179 ·
Tất cả issue của postcss/postcss-url
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
keyxmakerx/Chronicle#1532 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement feature good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug lsp sev-3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
学习模式 / 答疑模式在 DSH 0.2.1-rc.2 上必失败:unknown prompt variable "{{cwd}}"Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Miaotofu01/Study-Mate#206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Uuriko/project-room#3998 ·
Maintainer thường phản hồi trong vòng 1 ngày