From 9662cc3f9236de4a832473fb98c3f0f50ee3cde6 Mon Sep 17 00:00:00 2001 From: Ido Rosenthal Date: Sun, 1 Oct 2023 16:07:32 +0300 Subject: [PATCH] chore: fix usages --- packages/cli/src/build-stylable.ts | 2 +- packages/esbuild/src/stylable-esbuild-plugin.ts | 4 ++-- packages/rollup-plugin/src/index.ts | 4 ++-- packages/webpack-plugin/src/plugin.ts | 9 ++++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/cli/src/build-stylable.ts b/packages/cli/src/build-stylable.ts index c86715404..5c03d9a09 100644 --- a/packages/cli/src/build-stylable.ts +++ b/packages/cli/src/build-stylable.ts @@ -56,7 +56,7 @@ export async function buildStylable( watchOptions = {}, }: BuildStylableContext = {} ) { - const { config } = resolveConfig(rootDir, configFilePath, fs) || {}; + const { config } = resolveConfig(rootDir, fs, configFilePath) || {}; validateDefaultConfig(config?.defaultConfig); const projects = await projectsConfig(rootDir, overrideBuildOptions, defaultOptions, config); diff --git a/packages/esbuild/src/stylable-esbuild-plugin.ts b/packages/esbuild/src/stylable-esbuild-plugin.ts index 70ff8ec82..d55f62631 100644 --- a/packages/esbuild/src/stylable-esbuild-plugin.ts +++ b/packages/esbuild/src/stylable-esbuild-plugin.ts @@ -110,8 +110,8 @@ export const stylablePlugin = (initialPluginOptions: ESBuildOptions = {}): Plugi const projectRoot = build.initialOptions.absWorkingDir || process.cwd(); const configFromFile = resolveConfig( projectRoot, - typeof configFile === 'string' ? configFile : undefined, - fs + fs, + typeof configFile === 'string' ? configFile : undefined ); const stConfig = stylableConfig( { diff --git a/packages/rollup-plugin/src/index.ts b/packages/rollup-plugin/src/index.ts index 617cab041..70e222077 100644 --- a/packages/rollup-plugin/src/index.ts +++ b/packages/rollup-plugin/src/index.ts @@ -123,8 +123,8 @@ export function stylableRollupPlugin({ }); configFromFile = resolveStcConfig( stConfig.projectRoot, - typeof stcConfig === 'string' ? stcConfig : undefined, - fs + fs, + typeof stcConfig === 'string' ? stcConfig : undefined ); stylable = new Stylable({ diff --git a/packages/webpack-plugin/src/plugin.ts b/packages/webpack-plugin/src/plugin.ts index 3664d375f..46cf3c595 100644 --- a/packages/webpack-plugin/src/plugin.ts +++ b/packages/webpack-plugin/src/plugin.ts @@ -330,8 +330,8 @@ export class StylableWebpackPlugin { private getStylableConfig(compiler: Compiler) { const configuration = resolveStcConfig( compiler.context, - typeof this.options.stcConfig === 'string' ? this.options.stcConfig : undefined, - getTopLevelInputFilesystem(compiler) + getTopLevelInputFilesystem(compiler), + typeof this.options.stcConfig === 'string' ? this.options.stcConfig : undefined ); return configuration; @@ -359,7 +359,10 @@ export class StylableWebpackPlugin { return; } - const resolverOptions: Omit = { + const resolverOptions: Omit< + ResolveOptionsWebpackOptions, + 'fileSystem' | 'resolver' | 'plugins' + > = { ...compiler.options.resolve, aliasFields: compiler.options.resolve.byDependency?.esm?.aliasFields ||