Open
Description
Found some unexpected behaviour when using assetsPath.
Scenario
CSS Source: /style/css_src/index.css
Font Assets: /style/fonts/
Image Assets: /style/images/
PostCSS Generated CSS: /style/css/index.css
I am referencing my assets as such:
@font-face {
font-family: 'MyFont';
src: url('../fonts/MyFont.eot') format('eot');
}
.myClass {
background-image: url('../images/MyImage.png')
}
Using the following configuration with useHash enabled, assets are copied and hashed into /style/assets/
require('postcss-url')({
url: "copy",
assetsPath: '../assets/',
useHash: true
})
However using the following configuration without useHash enabled, assets are not copied anywhere
{
url: "copy",
assetsPath: '../assets/',
useHash: false
}
And using the following configuration without useHash, assets are copied into /style/css/fonts & /style/css/images
{
url: "copy",
assetsPath: './assets/',
useHash: false
}
Just for extra reference, the following configuration will see the assets copied into /style/css/assets/fonts & /style/css/assets/images
{
url: "copy",
assetsPath: './assets/somewhereElse',
useHash: false
}