Rename theme path

This commit is contained in:
Dave Gallant
2024-01-07 10:19:25 -05:00
parent b9926ba634
commit 51bd556992
122 changed files with 1 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
const path = require("path");
module.exports = () => ({
plugins: [
require("postcss-import")({
path: [
// Check for imports in <theme-dir>/css/assets
// TODO use Hugo's built-in inlineImports?
path.posix.join(__dirname, "assets", "css"),
],
}),
require("postcss-url")([
{
filter: "**/typeface-*/files/*",
url: (asset) => {
// Construct font path relative to <publish-dir>/css/bundle.css
// Fonts must be mounted into static/ dir
return path.posix.join("/", "fonts", path.basename(asset.pathname));
},
},
]),
require("postcss-nesting"),
require("postcss-custom-media"),
...(process.env.HUGO_ENVIRONMENT === "production"
? [
require("postcss-preset-env"),
require("cssnano"),
]
: []),
],
});