From 8e9dee46e43ac88f7f3b10efa9eec11d9609f43f Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Wed, 23 Dec 2020 14:13:13 -0500 Subject: [PATCH] reference projectDirectory context in rollup --- packages/cli/src/config/rollup.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/config/rollup.config.js b/packages/cli/src/config/rollup.config.js index 9638d0420..ca9cef812 100644 --- a/packages/cli/src/config/rollup.config.js +++ b/packages/cli/src/config/rollup.config.js @@ -33,7 +33,7 @@ function greenwoodWorkspaceResolver (compilation) { // https://github.com/rollup/rollup/issues/2873 function greenwoodHtmlPlugin(compilation) { - const { userWorkspace, outputDir } = compilation.context; + const { projectDirectory, userWorkspace, outputDir } = compilation.context; return { name: 'greenwood-html-plugin', @@ -126,10 +126,10 @@ function greenwoodHtmlPlugin(compilation) { const filePath = path.join(userWorkspace, asset.name); // TODO we already process the user's CSS as part of serve lifecycle (dev / build commands) // if we pull from .greenwood/ then maybe we could avoid re-postcss step here? - const userPostcssConfig = fs.existsSync(path.join(process.cwd(), 'postcss.config.js')) - ? require(path.join(process.cwd(), 'postcss.config')) + const userPostcssConfig = fs.existsSync(`${projectDirectory}/postcss.config.js`) + ? require(`${projectDirectory}/postcss.config`) : {}; - const userPostcssPlugins = userPostcssConfig.plugins + const userPostcssPlugins = userPostcssConfig.plugins && userPostcssConfig.plugins.length > 0 ? userPostcssConfig.plugins : []; const allPostcssPlugins = [