diff --git a/README.md b/README.md index faae14c..d272380 100644 --- a/README.md +++ b/README.md @@ -62,13 +62,12 @@ function ThemeProvider({ children }) { // (optional) defines with a glob where the styles are placed inside of @dnb/eufemia/... filesGlobs: [ '**/style/dnb-ui-core.min.css', - '**/style/themes/**/*-theme-{basis,components,extensions}.min.css', + '**/style/themes/**/*-theme-{basis,components}.min.css', ], // (optional) The file order does matter. Define a glob inside an array. includeFiles: [ '**/dnb-ui-core.*', - '**/*-theme-extensions.*', '**/*-theme-components.*', '**/*-theme-basis.*', ], @@ -79,9 +78,6 @@ function ThemeProvider({ children }) { // (optional) when set to false, your app will not be wrapped with the needed `` provider. wrapWithThemeProvider: true, - // (optional) when set to false, your app will have to import the core styles (dnb-ui-core) by yourself. - coreStyleName: 'dnb-ui-core', - // (optional) when set to true, the page scroll behaviour will not be effected. omitScrollBehavior: false, diff --git a/packages/gatsby-plugin-eufemia-theme-handler/src/collectThemes.ts b/packages/gatsby-plugin-eufemia-theme-handler/src/collectThemes.ts index e4a6aa8..46ff492 100644 --- a/packages/gatsby-plugin-eufemia-theme-handler/src/collectThemes.ts +++ b/packages/gatsby-plugin-eufemia-theme-handler/src/collectThemes.ts @@ -72,8 +72,8 @@ export function createThemesImport({ return { file, themeName } }) - .filter(({ themeName }) => { - return limitThemes.length === 0 || limitThemes.includes(themeName) + .filter(({ file }) => { + return !/\/(cjs|es|esm)\//.test(file) }) .sort((a, b) => { return ( @@ -86,15 +86,6 @@ export function createThemesImport({ ) }) - if (pluginOptions.coreStyleName) { - const coreFile = importFiles.find((file) => - file.includes(pluginOptions.coreStyleName) - ) - if (coreFile) { - sortedImportFiles.unshift({ file: coreFile }) - } - } - if (pluginOptions.verbose) { reporter.info( `sortedImportFiles:\n${sortedImportFiles diff --git a/packages/gatsby-plugin-eufemia-theme-handler/src/gatsby-node.ts b/packages/gatsby-plugin-eufemia-theme-handler/src/gatsby-node.ts index 74590f4..507c7f7 100644 --- a/packages/gatsby-plugin-eufemia-theme-handler/src/gatsby-node.ts +++ b/packages/gatsby-plugin-eufemia-theme-handler/src/gatsby-node.ts @@ -19,18 +19,16 @@ exports.pluginOptionsSchema = ({ Joi }) => { .optional() .default([ '**/style/dnb-ui-core.min.css', - '**/style/themes/**/*-theme-{basis,components,extensions}.min.css', + '**/style/themes/**/*-theme-{basis,components}.min.css', ]), includeFiles: Joi.array().optional().default([ // The file order does matter! '**/dnb-ui-core.*', - '**/*-theme-extensions.*', '**/*-theme-components.*', '**/*-theme-basis.*', ]), inlineDefaultTheme: Joi.boolean().optional().default(true), wrapWithThemeProvider: Joi.boolean().optional().default(true), - coreStyleName: Joi.string().optional().default('dnb-ui-core'), omitScrollBehavior: Joi.boolean().optional().default(false), verbose: Joi.boolean().optional().default(false), })