fix(v2): typo in resolve.roots (#4212)

This commit is contained in:
Sébastien Lorber 2021-02-10 11:48:41 +01:00 committed by GitHub
parent 0ac34b75c5
commit 780afe5278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -11,7 +11,7 @@ export const CONFIG_FILE_NAME = 'docusaurus.config.js';
export const GENERATED_FILES_DIR_NAME = '.docusaurus';
export const SRC_DIR_NAME = 'src';
export const STATIC_DIR_NAME = 'static';
export const STATIC_ASSETS_DIR_NAME = 'assets'; // files handled by webpack
export const OUTPUT_STATIC_ASSETS_DIR_NAME = 'assets'; // files handled by webpack, hashed (can be cached aggressively)
export const THEME_PATH = `${SRC_DIR_NAME}/theme`;
export const DEFAULT_PORT = 3000;
export const DEFAULT_PLUGIN_ID = 'default';

View file

@ -19,7 +19,7 @@ import {
getCustomBabelConfigFilePath,
getMinimizer,
} from './utils';
import {STATIC_ASSETS_DIR_NAME} from '../constants';
import {STATIC_DIR_NAME} from '../constants';
const CSS_REGEX = /\.css$/;
const CSS_MODULE_REGEX = /\.module\.css$/;
@ -96,7 +96,7 @@ export function createBaseConfig(
// Allow resolution of url("/fonts/xyz.ttf") by webpack
// See https://webpack.js.org/configuration/resolve/#resolveroots
// See https://github.com/webpack-contrib/css-loader/issues/1256
path.join(siteDir, STATIC_ASSETS_DIR_NAME),
path.join(siteDir, STATIC_DIR_NAME),
siteDir,
process.cwd(),
],

View file

@ -26,7 +26,10 @@ import {TransformOptions} from '@babel/core';
import {ConfigureWebpackFn, ConfigurePostCssFn} from '@docusaurus/types';
import CssNanoPreset from '@docusaurus/cssnano-preset';
import {version as cacheLoaderVersion} from 'cache-loader/package.json';
import {BABEL_CONFIG_FILE_NAME, STATIC_ASSETS_DIR_NAME} from '../constants';
import {
BABEL_CONFIG_FILE_NAME,
OUTPUT_STATIC_ASSETS_DIR_NAME,
} from '../constants';
// Utility method to get style loaders
export function getStyleLoaders(
@ -275,7 +278,7 @@ export function getFileLoaderUtils(): Record<string, any> {
// defines the path/pattern of the assets handled by webpack
const fileLoaderFileName = (folder: AssetFolder) =>
`${STATIC_ASSETS_DIR_NAME}/${folder}/[name]-[hash].[ext]`;
`${OUTPUT_STATIC_ASSETS_DIR_NAME}/${folder}/[name]-[hash].[ext]`;
const loaders = {
file: (options: {folder: AssetFolder}) => {