From 2c120d62d882402d5fc86cd02669805fb1a0c118 Mon Sep 17 00:00:00 2001 From: Natalia Luzuriaga Date: Mon, 27 Nov 2023 15:33:41 -0800 Subject: [PATCH 1/2] re-added vite back to project but removed postcss config file since not needed. uswds css applied on site. reconfig /metric to website url Signed-off-by: Natalia Luzuriaga --- app/.eleventy.js | 5 ++--- app/postcss.config.js | 28 ---------------------------- app/site/_data/site.js | 2 +- 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 app/postcss.config.js diff --git a/app/.eleventy.js b/app/.eleventy.js index 86ca94a52c..997255a766 100644 --- a/app/.eleventy.js +++ b/app/.eleventy.js @@ -1,6 +1,7 @@ const fs = require("fs") const path = require("path") const Image = require("@11ty/eleventy-img") +const EleventyVitePlugin = require("@11ty/eleventy-plugin-vite"); const lucideIcons = require("@grimlink/eleventy-plugin-lucide-icons"); const { baseurl } = require("./site/_data/site"); require("dotenv").config() @@ -78,6 +79,7 @@ module.exports = function (eleventyConfig) { }); eleventyConfig.setLiquidOptions({ outputEscape: "escape" }) + eleventyConfig.addPlugin(EleventyVitePlugin) eleventyConfig.addPlugin(lucideIcons, { "class": "custom-class", "width": 17, @@ -86,8 +88,6 @@ module.exports = function (eleventyConfig) { "stroke-width": 2 }); - const pathPrefix = process.env.NODE_ENV == "production" ? "/metrics" : "/" - return { dir: { input: "site/", @@ -97,6 +97,5 @@ module.exports = function (eleventyConfig) { }, templateFormats: ["html", "md", "liquid", "11ty.js"], passthroughFileCopy: true, - pathPrefix } } diff --git a/app/postcss.config.js b/app/postcss.config.js deleted file mode 100644 index b8a298f484..0000000000 --- a/app/postcss.config.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = { - plugins: [ - require("postcss-import"), - require("autoprefixer"), - ...(process.env.NODE_ENV === "production" - ? [ - require("cssnano"), - require("@fullhuman/postcss-purgecss")({ - content: [ - "./site/**/*.liquid", - "./site/**/*.html", - "./site/**/*.md", - "./src/**/*.js", - "./.11ty-vite/**/*.html", - "./.11ty-vite/**/*.js" - ], - safelist: ["usa-js-loading"], - extractors: [ - { - extractor: require("purgecss-from-html"), - extensions: ["html"], - }, - ], - }), - ] - : []), - ], -} \ No newline at end of file diff --git a/app/site/_data/site.js b/app/site/_data/site.js index cd415871e4..730d6e1132 100644 --- a/app/site/_data/site.js +++ b/app/site/_data/site.js @@ -3,7 +3,7 @@ const production = process.env.NODE_ENV === "production" const host = production ? process.env.SITE_HOST : "http://0.0.0.0:8080" // For modifying the tag -const baseurl = production ? "" : "" +const baseurl = production ? "/metrics" : "" module.exports = { name: "Open Source at CMS", From 858ed447b078b8006beb23b7a188da57f104584a Mon Sep 17 00:00:00 2001 From: Natalia Luzuriaga Date: Mon, 27 Nov 2023 15:36:15 -0800 Subject: [PATCH 2/2] Updated path of project css file. Now all css files are applied to website. Signed-off-by: Natalia Luzuriaga --- app/site/_includes/assets.liquid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/site/_includes/assets.liquid b/app/site/_includes/assets.liquid index ef55b6ba77..1a126d59d8 100644 --- a/app/site/_includes/assets.liquid +++ b/app/site/_includes/assets.liquid @@ -28,5 +28,5 @@ window.addEventListener('load', verifyLoaded, true) })() - +