File tree Expand file tree Collapse file tree 2 files changed +51
-7
lines changed
test/production/standalone-mode-and-optimizecss Expand file tree Collapse file tree 2 files changed +51
-7
lines changed Original file line number Diff line number Diff line change @@ -2085,14 +2085,15 @@ export default async function build(
2085
2085
} , [ ] ) ,
2086
2086
] ) {
2087
2087
const filePath = path . join ( dir , file )
2088
- await promises . copyFile (
2089
- filePath ,
2090
- path . join (
2091
- distDir ,
2092
- 'standalone' ,
2093
- path . relative ( outputFileTracingRoot , filePath )
2094
- )
2088
+ const outputPath = path . join (
2089
+ distDir ,
2090
+ 'standalone' ,
2091
+ path . relative ( outputFileTracingRoot , filePath )
2095
2092
)
2093
+ await promises . mkdir ( path . dirname ( outputPath ) , {
2094
+ recursive : true ,
2095
+ } )
2096
+ await promises . copyFile ( filePath , outputPath )
2096
2097
}
2097
2098
await recursiveCopy (
2098
2099
path . join ( distDir , SERVER_DIRECTORY , 'pages' ) ,
Original file line number Diff line number Diff line change
1
+ import { createNext } from 'e2e-utils'
2
+ import { NextInstance } from 'test/lib/next-modes/base'
3
+ import { renderViaHTTP } from 'next-test-utils'
4
+
5
+ describe ( 'standalone mode and optimizeCss' , ( ) => {
6
+ let next : NextInstance
7
+
8
+ beforeAll ( async ( ) => {
9
+ next = await createNext ( {
10
+ files : {
11
+ 'pages/index.js' : `
12
+ import styles from './index.module.css'
13
+
14
+ export default function Page() {
15
+ return <p className={styles.home}>hello world</p>
16
+ }
17
+ ` ,
18
+ 'pages/index.module.css' : `
19
+ .home {
20
+ background: orange;
21
+ color: black;
22
+ }
23
+ ` ,
24
+ } ,
25
+ nextConfig : {
26
+ experimental : {
27
+ optimizeCss : true ,
28
+ outputStandalone : true ,
29
+ } ,
30
+ } ,
31
+ dependencies : {
32
+ critters : 'latest' ,
33
+ } ,
34
+ } )
35
+ } )
36
+ afterAll ( ( ) => next . destroy ( ) )
37
+
38
+ it ( 'should work' , async ( ) => {
39
+ const html = await renderViaHTTP ( next . url , '/' )
40
+ expect ( html ) . toContain ( 'hello world' )
41
+ expect ( html ) . toContain ( 'background:orange' )
42
+ } )
43
+ } )
You can’t perform that action at this time.
0 commit comments