Skip to content

Commit

Permalink
fix: css loader postcss config
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Nov 16, 2020
1 parent 96303ae commit 284a552
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 47 deletions.
2 changes: 0 additions & 2 deletions core/webpack-configs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
"sass": "^1.27.0",
"sass-loader": "^10.0.4",
"style-loader": "^2.0.0",
"stylus": "^0.54.8",
"stylus-loader": "^4.1.1",
"typescript": "^4.0.5",
"url-loader": "^4.1.0",
"webpack": "^4.43.0"
Expand Down
17 changes: 7 additions & 10 deletions core/webpack-configs/src/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ export const react: PresetType = (options: BuildProps) => {
const isProd = process.env.NODE_ENV === 'production';
const cssLoaders: RuleSetLoader[] = [];
const postcssOptions = customLoaderOptions(options, 'postcss-loader', {});
const hasPostCss =
Object.keys(postcssOptions).length ||
findUpFile(process.cwd(), 'postcss.config.js');
const postCssOptionsFile = findUpFile(process.cwd(), 'postcss.config.js');
const hasPostCss = Object.keys(postcssOptions).length || postCssOptionsFile;
if (hasPostCss) {
cssLoaders.push({
loader: 'postcss-loader',
options: {},
options:
typeof postCssOptionsFile === 'string'
? require(postCssOptionsFile)
: {},
});
}
const result: PresetType = {
Expand Down Expand Up @@ -124,7 +126,7 @@ export const react: PresetType = (options: BuildProps) => {
],
},
{
test: /\.(css|sass|scss|less|styl)$/i,
test: /\.(css|sass|scss|less)$/i,
use: [
// Creates `style` nodes from JS strings
// will export to a consolidated css file
Expand All @@ -145,11 +147,6 @@ export const react: PresetType = (options: BuildProps) => {
loader: 'less-loader',
options: customLoaderOptions(options, 'less-loader', {}),
},
{
// Compiles stylus to CSS
loader: 'stylus-loader',
options: customLoaderOptions(options, 'stylus-loader', {}),
},
],
},
{
Expand Down
38 changes: 3 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9609,13 +9609,6 @@ css-loader@^5.0.0:
schema-utils "^3.0.0"
semver "^7.3.2"

css-parse@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-2.0.0.tgz#a468ee667c16d81ccf05c58c38d2a97c780dbfd4"
integrity sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q=
dependencies:
css "^2.0.0"

css-select-base-adapter@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz#3b2ff4972cc362ab88561507a95408a1432135d7"
Expand Down Expand Up @@ -11853,7 +11846,7 @@ fast-glob@^2.0.2, fast-glob@^2.2.6:
merge2 "^1.2.3"
micromatch "^3.1.10"

fast-glob@^3.0.3, fast-glob@^3.0.4, fast-glob@^3.1.1, fast-glob@^3.2.4:
fast-glob@^3.0.3, fast-glob@^3.0.4, fast-glob@^3.1.1:
version "3.2.4"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3"
integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==
Expand Down Expand Up @@ -17713,7 +17706,7 @@ mkdirp-promise@^5.0.1:
dependencies:
mkdirp "*"

mkdirp@*, mkdirp@^1.0.3, mkdirp@^1.0.4, mkdirp@~1.0.4:
mkdirp@*, mkdirp@^1.0.3, mkdirp@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
Expand Down Expand Up @@ -22250,7 +22243,7 @@ safe-regex@^1.1.0:
dependencies:
ret "~0.1.10"

"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@^2.1.2, safer-buffer@~2.1.0:
"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
Expand Down Expand Up @@ -23633,31 +23626,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.4.tgz#f665f25f5e299cf3d64654ab949a57c768b73fbe"
integrity sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q==

stylus-loader@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/stylus-loader/-/stylus-loader-4.1.1.tgz#0e94f5d6274932a2dad054d1a736b32146ac7a99"
integrity sha512-Vnm7J/nIs/P6swIrdwJW/dflhsCOiFmb1U3PeQ6phRtg1soPLN4uKnnL7AtGIJDe173elbtYIXVzmCyF493CfA==
dependencies:
fast-glob "^3.2.4"
klona "^2.0.4"
loader-utils "^2.0.0"
normalize-path "^3.0.0"
schema-utils "^3.0.0"

stylus@^0.54.8:
version "0.54.8"
resolved "https://registry.yarnpkg.com/stylus/-/stylus-0.54.8.tgz#3da3e65966bc567a7b044bfe0eece653e099d147"
integrity sha512-vr54Or4BZ7pJafo2mpf0ZcwA74rpuYCZbxrHBsH8kbcXOwSfvBFwsRfpGO5OD5fhG5HDCFW737PKaawI7OqEAg==
dependencies:
css-parse "~2.0.0"
debug "~3.1.0"
glob "^7.1.6"
mkdirp "~1.0.4"
safer-buffer "^2.1.2"
sax "~1.2.4"
semver "^6.3.0"
source-map "^0.7.3"

[email protected], subscriptions-transport-ws@^0.9.16:
version "0.9.18"
resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.18.tgz#bcf02320c911fbadb054f7f928e51c6041a37b97"
Expand Down

0 comments on commit 284a552

Please sign in to comment.