Skip to content

Commit

Permalink
Make the path to the node package also dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
dzole0311 committed Jul 30, 2024
1 parent e33520a commit 5f21b87
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ const fs = require('fs-extra');
const CWD = process.cwd();

const vedaPath = path.resolve(CWD, '.veda/ui');

const isVedaInstance = fs.existsSync(vedaPath);

let uswdsPath = path.resolve(CWD, 'node_modules/@trussworks/react-uswds/lib');

if (isVedaInstance)
uswdsPath = path.resolve(
CWD,
'.veda/ui',
'node_modules/@trussworks/react-uswds/lib'
);

const contentPaths = isVedaInstance
? [
'.veda/ui/app/**/*.{js,jsx,ts,tsx}',
'@trussworks/react-uswds/lib/index.css'
]
: ['./app/**/*.{js,jsx,ts,tsx}', '@trussworks/react-uswds/lib/index.css'];
? ['.veda/ui/app/**/*.{js,jsx,ts,tsx}', `${uswdsPath}/index.css`]
: ['./app/**/*.{js,jsx,ts,tsx}', `${uswdsPath}/index.css`];

let plugins = [require('autoprefixer'), require('postcss-import')];
const purge = require('@fullhuman/postcss-purgecss')({
Expand Down

0 comments on commit 5f21b87

Please sign in to comment.