Skip to content

Commit

Permalink
fix(v2): remove style-loader, use minicssextract in both dev & prod f…
Browse files Browse the repository at this point in the history
…or consistency
  • Loading branch information
endiliey committed Dec 25, 2019
1 parent 8b26d92 commit bf316f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"semver": "^6.3.0",
"shelljs": "^0.8.3",
"std-env": "^2.2.1",
"style-loader": "1.0.2",
"terser-webpack-plugin": "^2.2.1",
"wait-file": "^1.0.5",
"webpack": "^4.41.2",
Expand Down
8 changes: 5 additions & 3 deletions packages/docusaurus/src/webpack/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ export function getStyleLoaders(

const isProd = process.env.NODE_ENV === 'production';
const loaders = [
isProd && {
{
loader: MiniCssExtractPlugin.loader,
options: {
hmr: !isProd,
},
},
!isProd && require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: cssOptions,
Expand All @@ -60,7 +62,7 @@ export function getStyleLoaders(
],
},
},
].filter(Boolean) as Loader[];
];
return loaders;
}

Expand Down
10 changes: 1 addition & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13438,7 +13438,7 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"

schema-utils@^2.0.0, schema-utils@^2.0.1, schema-utils@^2.6.0, schema-utils@^2.6.1:
schema-utils@^2.0.0, schema-utils@^2.6.0, schema-utils@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.1.tgz#eb78f0b945c7bcfa2082b3565e8db3548011dc4f"
integrity sha512-0WXHDs1VDJyo+Zqs9TKLKyD/h7yDpHUhEFsM2CzkICFdoX1av+GBq/J2xRTFfsQO5kBfhZzANf2VcIm84jqDbg==
Expand Down Expand Up @@ -14302,14 +14302,6 @@ strong-log-transformer@^2.0.0:
minimist "^1.2.0"
through "^2.3.4"

style-loader@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.0.2.tgz#433d72eab8d1dd7d64c648b8ad7d9cbff3184111"
integrity sha512-xehHGWeCPrr+R/bU82To0j7L7ENzH30RHYmMhmAumbuIpQ/bHmv3SAj1aTRfBSszkXoqNtpKnJyWXEDydS+KeA==
dependencies:
loader-utils "^1.2.3"
schema-utils "^2.0.1"

style-to-object@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46"
Expand Down

0 comments on commit bf316f6

Please sign in to comment.