File tree Expand file tree Collapse file tree 11 files changed +58
-3
lines changed
__tests__/next-12-react-18-local Expand file tree Collapse file tree 11 files changed +58
-3
lines changed Original file line number Diff line number Diff line change
1
+ package-lock = false
Original file line number Diff line number Diff line change
1
+ const { withGlobalCss } = require ( '../../lib' )
2
+
3
+ module . exports = withGlobalCss ( ) ( )
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " next-10-local" ,
3
+ "version" : " 0.0.1" ,
4
+ "private" : " true" ,
5
+ "scripts" : {
6
+ "build" : " next build" ,
7
+ "dev" : " next dev"
8
+ },
9
+ "dependencies" : {
10
+ "3d-party-library" : " file:../__fixtures__/3d-party-library/3d-party-library-0.0.1.tgz" ,
11
+ "next" : " ^12.1.4" ,
12
+ "react" : " ^18.0.0" ,
13
+ "react-dom" : " ^18.0.0" ,
14
+ "sass" : " ^1.34.0"
15
+ }
16
+ }
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ export default function MyApp ( { Component, pageProps } ) {
4
+ return < Component { ...pageProps } />
5
+ }
Original file line number Diff line number Diff line change
1
+ import { Component } from '3d-party-library/component'
2
+ import { ScssComponent } from '../src/components/scss-component'
3
+ import { CssComponent } from '../src/components/css-component'
4
+
5
+ export default function Home ( ) {
6
+ return (
7
+ < >
8
+ < Component />
9
+ < ScssComponent />
10
+ < CssComponent />
11
+ </ >
12
+ )
13
+ }
Original file line number Diff line number Diff line change
1
+ import './styles.css'
2
+
3
+ export const CssComponent = ( ) => {
4
+ return < button className = "css-button" > CssComponent</ button >
5
+ }
Original file line number Diff line number Diff line change
1
+ .css-button {
2
+ color : red;
3
+ }
Original file line number Diff line number Diff line change
1
+ import './styles.scss'
2
+
3
+ export const ScssComponent = ( ) => {
4
+ return < button className = "scss-button" > ScssComponent</ button >
5
+ }
Original file line number Diff line number Diff line change
1
+ .scss-button {
2
+ color : red ;
3
+ }
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ function patchServerWebpackConfig(config) {
6
6
const entry = await originalEntry ( )
7
7
const patchPath = require . resolve ( './patch-global-require' )
8
8
// Prepend module with patched `require` for ignore load css files.
9
- if ( ! entry [ 'pages/_app' ] . includes ( patchPath ) ) {
9
+ if ( entry [ 'pages/_app' ] && ! entry [ 'pages/_app' ] . includes ( patchPath ) ) {
10
10
entry [ 'pages/_app' ] . unshift ( patchPath )
11
11
}
12
- if ( ! entry [ 'pages/_document' ] . includes ( patchPath ) ) {
12
+ if ( entry [ 'pages/_document' ] && ! entry [ 'pages/_document' ] . includes ( patchPath ) ) {
13
13
entry [ 'pages/_document' ] . unshift ( patchPath )
14
14
}
15
15
return entry
Original file line number Diff line number Diff line change 18
18
"test-next-10-local" : " node ./__tests__/index.test.js --version=10-local" ,
19
19
"test-next-10-ssr" : " node ./__tests__/index.test.js --version=10-ssr" ,
20
20
"test-next-10" : " node ./__tests__/index.test.js --version=10" ,
21
- "test" : " npm run test-next-10-local && npm run test-next-10-ssr && npm run test-next-10"
21
+ "test-next-12-react-18-local" : " node ./__tests__/index.test.js --version=12-react-18-local" ,
22
+ "test" : " npm run test-next-10-local && npm run test-next-10-ssr && npm run test-next-10 && npm run test-next-12-react-18-local"
22
23
}
23
24
}
You can’t perform that action at this time.
0 commit comments