mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(core): apply staticDirectories to base webpack config (#5965)
This commit is contained in:
parent
1366c31201
commit
623a5cc022
2 changed files with 4 additions and 3 deletions
|
@ -82,7 +82,7 @@ describe('base webpack config', () => {
|
||||||
const props: Props = {
|
const props: Props = {
|
||||||
outDir: '',
|
outDir: '',
|
||||||
siteDir: path.resolve(__dirname, '__fixtures__', 'base_test_site'),
|
siteDir: path.resolve(__dirname, '__fixtures__', 'base_test_site'),
|
||||||
siteConfig: {},
|
siteConfig: {staticDirectories: ['static']},
|
||||||
baseUrl: '',
|
baseUrl: '',
|
||||||
generatedFilesDir: '',
|
generatedFilesDir: '',
|
||||||
routesPaths: [''],
|
routesPaths: [''],
|
||||||
|
|
|
@ -17,7 +17,6 @@ import {
|
||||||
getCustomBabelConfigFilePath,
|
getCustomBabelConfigFilePath,
|
||||||
getMinimizer,
|
getMinimizer,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import {STATIC_DIR_NAME} from '../constants';
|
|
||||||
import {loadPluginsThemeAliases} from '../server/themes';
|
import {loadPluginsThemeAliases} from '../server/themes';
|
||||||
import {md5Hash} from '@docusaurus/utils';
|
import {md5Hash} from '@docusaurus/utils';
|
||||||
|
|
||||||
|
@ -144,7 +143,9 @@ export function createBaseConfig(
|
||||||
// Allow resolution of url("/fonts/xyz.ttf") by webpack
|
// Allow resolution of url("/fonts/xyz.ttf") by webpack
|
||||||
// See https://webpack.js.org/configuration/resolve/#resolveroots
|
// See https://webpack.js.org/configuration/resolve/#resolveroots
|
||||||
// See https://github.com/webpack-contrib/css-loader/issues/1256
|
// See https://github.com/webpack-contrib/css-loader/issues/1256
|
||||||
path.join(siteDir, STATIC_DIR_NAME),
|
...siteConfig.staticDirectories.map((dir) =>
|
||||||
|
path.resolve(siteDir, dir),
|
||||||
|
),
|
||||||
siteDir,
|
siteDir,
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue