Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function getGlobalCssLoader(
cssFileResolve(url, resourcePath, ctx.experimental.urlImports),
import: (url: string, _: any, resourcePath: string) =>
cssFileResolve(url, resourcePath, ctx.experimental.urlImports),
modules: false,
targets: ctx.supportedBrowsers,
postcss,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { ECacheKey } from './interface'

const encoder = new TextEncoder()

const moduleRegExp = /\.module\.\w+$/i

function createUrlAndImportVisitor(
visitorOptions: any,
apis: ApiParam[],
Expand Down Expand Up @@ -364,14 +362,13 @@ export async function LightningCssLoader(
} = transform({
...opts,
visitor,
cssModules:
options.modules && moduleRegExp.test(this.resourcePath)
? {
pattern: process.env.__NEXT_TEST_MODE
? '[name]__[local]'
: '[name]__[hash]__[local]',
}
: undefined,
cssModules: options.modules
? {
pattern: process.env.__NEXT_TEST_MODE
? '[name]__[local]'
: '[name]__[hash]__[local]',
}
: undefined,
filename: this.resourcePath,
code: encoder.encode(source),
sourceMap: this.sourceMap,
Expand Down