next-transpile-modules
Advanced tools
Comparing version 7.1.2 to 7.2.0
{ | ||
"name": "next-transpile-modules", | ||
"version": "7.1.2", | ||
"version": "7.2.0", | ||
"license": "MIT", | ||
@@ -18,3 +18,3 @@ "author": "Pierre de la Martinière <pierre.de.la.martiniere@gmail.com>", | ||
"pretest": "npm run setup", | ||
"quickie": "node --trace-uncaught src/__tests__/setup.js && yarn --cwd src/__tests__/__apps__/webpack-4/app run build", | ||
"quickie": "node --trace-uncaught src/__tests__/setup.js && yarn --cwd src/__tests__/__apps__/yarn-workspaces/app run dev", | ||
"test": "jest --forceExit", | ||
@@ -21,0 +21,0 @@ "test:debug": "jest --detectOpenHandles --forceExit", |
@@ -201,3 +201,2 @@ /** | ||
} | ||
if (resolveSymlinks !== undefined) { | ||
@@ -316,2 +315,30 @@ // Avoid Webpack to resolve transpiled modules path to their real path as | ||
// Add support for Global CSS imports in transpiled modules | ||
if (nextCssLoaders) { | ||
const nextGlobalCssLoader = nextCssLoaders.oneOf.find( | ||
(rule) => rule.sideEffects === true && regexEqual(rule.test, /(?<!\.module)\.css$/) | ||
); | ||
if (nextGlobalCssLoader) { | ||
nextGlobalCssLoader.issuer = { or: [matcher, nextGlobalCssLoader.issuer] }; | ||
nextGlobalCssLoader.include = { or: [...modulesPaths, nextGlobalCssLoader.include] }; | ||
} else if (!options.isServer) { | ||
// Note that Next.js ignores global CSS imports on the server | ||
console.warn('next-transpile-modules - could not find default CSS rule, global CSS imports may not work'); | ||
} | ||
const nextGlobalSassLoader = nextCssLoaders.oneOf.find( | ||
(rule) => rule.sideEffects === true && regexEqual(rule.test, /(?<!\.module)\.(scss|sass)$/) | ||
); | ||
// FIXME: SASS works only when using a custom _app.js file. | ||
// See https://github.com/vercel/next.js/blob/24c3929ec46edfef8fb7462a17edc767a90b5d2b/packages/next/build/webpack/config/blocks/css/index.ts#L211 | ||
if (nextGlobalSassLoader) { | ||
nextGlobalSassLoader.issuer = { or: [matcher, nextGlobalSassLoader.issuer] }; | ||
} else if (!options.isServer) { | ||
// Note that Next.js ignores global SASS imports on the server | ||
console.info('next-transpile-modules - global SASS imports only work with a custom _app.js file'); | ||
} | ||
} | ||
// Make hot reloading work! | ||
@@ -318,0 +345,0 @@ // FIXME: not working on Wepback 5 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29627
324