From 5fce013d485ff0b0d1102325968451012d9eecbe Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 30 Mar 2023 14:51:15 +0200 Subject: [PATCH] Add explicit require.resolve calls to nextjs webpack loader config --- code/frameworks/nextjs/src/css/webpack.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/frameworks/nextjs/src/css/webpack.ts b/code/frameworks/nextjs/src/css/webpack.ts index a87f0bb280e3..f673aeaf36f8 100644 --- a/code/frameworks/nextjs/src/css/webpack.ts +++ b/code/frameworks/nextjs/src/css/webpack.ts @@ -15,9 +15,9 @@ export const configureCss = (baseConfig: WebpackConfig, nextConfig: NextConfig): rules[i] = { test: /\.css$/, use: [ - 'style-loader', + require.resolve('style-loader'), { - loader: 'css-loader', + loader: require.resolve('css-loader'), options: { importLoaders: 1, ...getImportAndUrlCssLoaderOptions(nextConfig), @@ -27,7 +27,7 @@ export const configureCss = (baseConfig: WebpackConfig, nextConfig: NextConfig): }, }, }, - 'postcss-loader', + require.resolve('postcss-loader'), ], }; } @@ -35,19 +35,19 @@ export const configureCss = (baseConfig: WebpackConfig, nextConfig: NextConfig): rules?.push({ test: /\.(scss|sass)$/, use: [ - 'style-loader', + require.resolve('style-loader'), { - loader: 'css-loader', + loader: require.resolve('css-loader'), options: { importLoaders: 3, ...getImportAndUrlCssLoaderOptions(nextConfig), modules: { auto: true, getLocalIdent: getCssModuleLocalIdent }, }, }, - 'postcss-loader', - 'resolve-url-loader', + require.resolve('postcss-loader'), + require.resolve('resolve-url-loader'), { - loader: 'sass-loader', + loader: require.resolve('sass-loader'), options: { sourceMap: true, sassOptions: nextConfig.sassOptions,