From 6dd2ddd3c11e3e3c28c71b3d7ecfe86e4ce0dfc2 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 20 Jul 2024 20:48:15 -0400 Subject: [PATCH] patching with greenwood super css --- greenwood.config.js | 4 +- patches/@greenwood+cli+0.30.0-alpha.4.patch | 273 ++++++++------------ postcss.config.cjs | 1 - postcss.config.mjs | 1 - 4 files changed, 111 insertions(+), 168 deletions(-) diff --git a/greenwood.config.js b/greenwood.config.js index a1c77fc..0fa2665 100644 --- a/greenwood.config.js +++ b/greenwood.config.js @@ -1,7 +1,7 @@ import { greenwoodPluginFontAwesome } from '@analogstudiosri/greenwood-plugin-font-awesome'; import { greenwoodPluginGoogleAnalytics } from '@greenwood/plugin-google-analytics'; import { greenwoodPluginTypeScript } from '@greenwood/plugin-typescript'; -// import { greenwoodPluginPostCss } from '@greenwood/plugin-postcss'; +import { greenwoodPluginPostCss } from '@greenwood/plugin-postcss'; import analyze from 'rollup-plugin-analyzer'; import { visualizer } from 'rollup-plugin-visualizer'; import dynamicImportVariables from '@rollup/plugin-dynamic-import-vars'; @@ -14,7 +14,7 @@ export default { } }, plugins: [ - // greenwoodPluginPostCss(), + greenwoodPluginPostCss(), greenwoodPluginFontAwesome(), greenwoodPluginTypeScript(), // https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications diff --git a/patches/@greenwood+cli+0.30.0-alpha.4.patch b/patches/@greenwood+cli+0.30.0-alpha.4.patch index a700183..057367b 100644 --- a/patches/@greenwood+cli+0.30.0-alpha.4.patch +++ b/patches/@greenwood+cli+0.30.0-alpha.4.patch @@ -1,35 +1,58 @@ diff --git a/node_modules/@greenwood/cli/src/config/rollup.config.js b/node_modules/@greenwood/cli/src/config/rollup.config.js -index 7771d11..9f338e1 100644 +index 7771d11..5d48e0c 100644 --- a/node_modules/@greenwood/cli/src/config/rollup.config.js +++ b/node_modules/@greenwood/cli/src/config/rollup.config.js -@@ -21,7 +21,7 @@ function greenwoodResourceLoader (compilation) { +@@ -12,7 +12,9 @@ function cleanRollupId(id) { + return id.replace('\x00', '').replace('?commonjs-proxy', ''); + } + +-function greenwoodResourceLoader (compilation) { ++function greenwoodResourceLoader (compilation, browser = false) { ++ // ConstructableStylesheets, JSON Modules ++ const externalizedResources = ['css', 'json']; + const resourcePlugins = compilation.config.plugins.filter((plugin) => { + return plugin.type === 'resource'; + }).map((plugin) => { +@@ -21,16 +23,29 @@ function greenwoodResourceLoader (compilation) { return { name: 'greenwood-resource-loader', - async resolveId(id) { +- const normalizedId = cleanRollupId(id); // idUrl.pathname; +- const { projectDirectory, userWorkspace } = compilation.context; +- +- if (normalizedId.startsWith('.') && !normalizedId.startsWith(projectDirectory.pathname)) { + async resolveId(id, importer) { - const normalizedId = cleanRollupId(id); // idUrl.pathname; - const { projectDirectory, userWorkspace } = compilation.context; - -@@ -29,8 +29,15 @@ function greenwoodResourceLoader (compilation) { ++ const normalizedId = cleanRollupId(id); ++ const { userWorkspace } = compilation.context; ++ ++ // check for non bare paths and resolve them to the user's workspace ++ // or Greenwood's scratch dir, like when bundling inline