* Fix context reuse test * Don't update files with at-apply when content changes * Prevent at-apply directives from creating new contexts * Rework apply to use local postcss root We were storing user CSS in the context so we could use it with apply. The problem is that this CSS does not get updated on save unless it has a tailwind directive in it resulting in stale apply caches. This could result in either stale generation or errors about missing classes. * Don’t build local cache unless `@apply` is used * Update changelog
24 lines
478 B
JavaScript
24 lines
478 B
JavaScript
export default function cloneNodes(nodes, source = undefined, raws = undefined) {
|
|
return nodes.map((node) => {
|
|
let cloned = node.clone()
|
|
|
|
if (source !== undefined) {
|
|
cloned.source = source
|
|
|
|
if ('walk' in cloned) {
|
|
cloned.walk((child) => {
|
|
child.source = source
|
|
})
|
|
}
|
|
}
|
|
|
|
if (raws !== undefined) {
|
|
cloned.raws.tailwind = {
|
|
...cloned.raws.tailwind,
|
|
...raws,
|
|
}
|
|
}
|
|
|
|
return cloned
|
|
})
|
|
}
|