Skip to content

Commit

Permalink
Showing 4 changed files with 657 additions and 343 deletions.
943 changes: 620 additions & 323 deletions package-lock.json

Large diffs are not rendered by default.

52 changes: 36 additions & 16 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -68,6 +68,11 @@ const imageInlineSizeLimit = parseInt(
// Check if TypeScript is setup
const useTypeScript = fs.existsSync(paths.appTsConfig);

// Check if Tailwind config exists
const useTailwind = fs.existsSync(
path.join(paths.appPath, 'tailwind.config.js')
);

// Get the path to the uncompiled service worker (if it exists).
const swSrc = paths.swSrc;

@@ -135,22 +140,37 @@ module.exports = function (webpackEnv) {
// Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
plugins: [
'postcss-flexbugs-fixes',
[
'postcss-preset-env',
{
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
},
],
// Adds PostCSS Normalize as the reset css with default options,
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
'postcss-normalize',
],
config: false,
plugins: !useTailwind
? [
'postcss-flexbugs-fixes',
[
'postcss-preset-env',
{
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
},
],
// Adds PostCSS Normalize as the reset css with default options,
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
'postcss-normalize',
]
: [
'tailwindcss',
'postcss-flexbugs-fixes',
[
'postcss-preset-env',
{
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
},
],
],
},
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
},
1 change: 1 addition & 0 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@
"semver": "^7.3.5",
"source-map-loader": "^3.0.0",
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.2",
"terser-webpack-plugin": "^5.2.5",
"webpack": "^5.64.4",
"webpack-dev-server": "^4.6.0",
4 changes: 0 additions & 4 deletions tasks/cra.js
Original file line number Diff line number Diff line change
@@ -104,10 +104,6 @@ const scriptsFileName = cp
.toString()
.trim();
const scriptsPath = path.join(packagesDir, 'react-scripts', scriptsFileName);

// Now that we have packed them, call the global CLI.
cp.execSync('npm cache clean');

const args = process.argv.slice(2);

// Now run the CRA command

0 comments on commit 5614c87

Please sign in to comment.