Skip to content

Commit

Permalink
Add Global CSS test
Browse files Browse the repository at this point in the history
  • Loading branch information
martpie committed Jan 16, 2020
1 parent 89e9312 commit 6aa223e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/__tests__/__apps__/_shared-ui/styles/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
background-color: black;
color: white;
}
5 changes: 5 additions & 0 deletions src/__tests__/__apps__/basic/pages/_app.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'shared-ui/styles/global.css';

export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
4 changes: 1 addition & 3 deletions src/next-transpile-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const withTm = (transpileModules = []) => (nextConfig = {}) => {
include: includes
});

// Support CSS modules in node_modules
// Support CSS modules + global in node_modules
// TODO ask Next.js maintainer to expose the css-loader via defaultLoaders
const nextCssLoaders = config.module.rules.find((rule) => typeof rule.oneOf === 'object');

Expand All @@ -107,8 +107,6 @@ const withTm = (transpileModules = []) => (nextConfig = {}) => {
}
}

// .css (global CSS)

// Overload the Webpack config if it was already overloaded
if (typeof nextConfig.webpack === 'function') {
return nextConfig.webpack(config, options);
Expand Down

0 comments on commit 6aa223e

Please sign in to comment.