Skip to content

Commit

Permalink
reference projectDirectory context in rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Dec 23, 2020
1 parent b01d1a5 commit 8e9dee4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/cli/src/config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit 8e9dee4

Please sign in to comment.