postcss / postcss-url

PostCSS plugin to rebase url(), inline or copy asset.
MIT License
377 stars 60 forks source link

whats wrong with this it doesnt work.. at all looks there no processing done #178

Closed pascalvos closed 1 year ago

pascalvos commented 1 year ago
require('postcss-url')([
    { filter: /\.woff2$/, url: (asset) => `http://localhost:3500/${asset.url}` },
    { filter: /\.woff$/, url: (asset) => `http://localhost:3500/${asset.url}`  },
]),
pascalvos commented 1 year ago

think the problem is @import "~@somnpmpackage/src/scss/fonts/font-name"; and in there is url(font-path("#{$font-path}/font-name/font-name-Regular.woff2", false)) format("woff2"),

pascalvos commented 1 year ago

oke fixed it whit this { filter: '*/.woff2', url: (asset, ) => http://localhost:3500/${asset.url.replace('~', 'node_modules/')}, useHash: true, },