From 39245e3e88d12a80f04e353a7bc037e75112c4f9 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 23 Jun 2023 12:20:25 -0700 Subject: [PATCH] Modify next.js to re-enable CSS modules --- next.config.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/next.config.js b/next.config.js index c268ed51..a86c741b 100644 --- a/next.config.js +++ b/next.config.js @@ -54,14 +54,24 @@ module.exports = { ] }, webpack(config) { + // Set up alias for styles + config.resolve.alias = { + ...config.resolve.alias, + '@styles': path.resolve(__dirname, 'styles'), + } + + // Set up rules for SVG files config.module.rules.push({ test: /\.svg$/, use: ['@svgr/webpack'], }) - config.module.rules[2].oneOf.forEach((one) => { - if (!`${one.issuer?.and}`.includes('_app')) return - one.issuer.and = [path.resolve(__dirname)] - }) + + // Disable CSS modules + // config.module.rules[2].oneOf.forEach((one) => { + // if (!`${one.issuer?.and}`.includes('_app')) return + // one.issuer.and = [path.resolve(__dirname)] + // }) + return config }, }