posthtml-postcss-modules icon indicating copy to clipboard operation
posthtml-postcss-modules copied to clipboard

Support relative imports

Open textpain opened this issue 4 years ago • 2 comments

Consider the following structure:

index.html
header
|--header.html
|--header.css

index.html

<include src="./header/header.html"></include>

header/header.html

<link href="./header.css" module>

Build will fail. I tried to solve this with __dirname hacks in posthtml.config.js with no success.

It seems almost intuitive for this package to support relative paths like this. Please, consider implementing this functionality because this is the only thing that stops me from adopting this package all over everything I do.

Thanks!

textpain avatar Apr 09 '21 11:04 textpain

P.S. I'm using posthtml-include for includes. This is my config:

"posthtml-include": {
    root: path.join(__dirname, './src')
}

textpain avatar Apr 09 '21 12:04 textpain

@stevenvachon Hi, great suggestion, I'll take it as soon as possible. You can feel free to contribute

Scrum avatar Apr 12 '21 11:04 Scrum