Skip to content

Commit

Permalink
fix(core): configurePostCss() should run after configureWebpack() (
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored May 13, 2024
1 parent 29b7a4d commit ff5039f
Show file tree
Hide file tree
Showing 7 changed files with 620 additions and 405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {isMatch} from 'picomatch';
import commander from 'commander';
import webpack from 'webpack';
import {loadContext} from '@docusaurus/core/src/server/site';
import {applyConfigureWebpack} from '@docusaurus/core/src/webpack/utils';
import {applyConfigureWebpack} from '@docusaurus/core/src/webpack/configure';
import {sortRoutes} from '@docusaurus/core/src/server/plugins/routeConfig';
import {posixPath} from '@docusaurus/utils';
import {normalizePluginOptions} from '@docusaurus/utils-validation';
Expand Down
11 changes: 2 additions & 9 deletions packages/docusaurus/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ import {handleBrokenLinks} from '../server/brokenLinks';

import {createBuildClientConfig} from '../webpack/client';
import createServerConfig from '../webpack/server';
import {
executePluginsConfigurePostCss,
executePluginsConfigureWebpack,
compile,
} from '../webpack/utils';
import {executePluginsConfigureWebpack} from '../webpack/configure';
import {compile} from '../webpack/utils';
import {PerfLogger} from '../utils';

import {loadI18n} from '../server/i18n';
Expand Down Expand Up @@ -325,10 +322,6 @@ async function getBuildClientConfig({
bundleAnalyzer: cliOptions.bundleAnalyzer ?? false,
});
let {config} = result;
config = executePluginsConfigurePostCss({
plugins,
config,
});
config = executePluginsConfigureWebpack({
plugins,
config,
Expand Down
4 changes: 1 addition & 3 deletions packages/docusaurus/src/commands/start/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ import WebpackDevServer from 'webpack-dev-server';
import evalSourceMapMiddleware from 'react-dev-utils/evalSourceMapMiddleware';
import {createPollingOptions} from './watcher';
import {
executePluginsConfigurePostCss,
executePluginsConfigureWebpack,
formatStatsErrorMessage,
getHttpsConfig,
printStatsWarnings,
} from '../../webpack/utils';
import {executePluginsConfigureWebpack} from '../../webpack/configure';
import {createStartClientConfig} from '../../webpack/client';
import type {StartCLIOptions} from './start';
import type {Props} from '@docusaurus/types';
Expand Down Expand Up @@ -135,7 +134,6 @@ async function getStartClientConfig({
minify,
poll,
});
config = executePluginsConfigurePostCss({plugins, config});
config = executePluginsConfigureWebpack({
plugins,
config,
Expand Down
Loading

0 comments on commit ff5039f

Please sign in to comment.