deg-skeletor/skeletor-plugin-patternlab

Export Task should fix asset paths

Closed this issue · 1 comments

Patternlab uses paths like ../../css/global.css
Exporting from patternlab, it would be good if these paths were fixed to css/global.css.

To accommodate asset path replacement on export, I'm considering something like this for the "patternExport" portion of this plugin's configuration:

"patternExport": { "patternGroups": [ { patterns: 'pages/*', dest: './dist/patterns/', includeHeadFoot: true } ], "assetPathReplacements": [ { path: "../../images", replacementPath: "images" }, { path: "../../css", replacementPath: "css" } ] }

The "assetPathReplacements" property would be an array of asset paths to replace. For example, "../../images/test.jpg" would be replaced with "images/test.jpg" given the above configuration. Let me know what you guys think.