File tree Expand file tree Collapse file tree 4 files changed +14
-31
lines changed Expand file tree Collapse file tree 4 files changed +14
-31
lines changed Original file line number Diff line number Diff line change 1
- import { resolve } from 'path'
2
- import type { NuxtConfig } from '@nuxt/types'
3
- import { resolveConfig } from '../../../src/index'
1
+ import { nuxtConfig } from '../../../src/index'
4
2
5
- export default < NuxtConfig > resolveConfig ( {
6
- name : 'myApp' ,
7
- rootDir : __dirname ,
3
+ export default nuxtConfig ( {
4
+ name : 'MyApp' ,
8
5
extends : '../themes/red/nuxt.config' ,
9
-
10
- components : [
11
- resolve ( __dirname , 'components' )
12
- ]
6
+ rootDir : __dirname
13
7
} )
Original file line number Diff line number Diff line change 1
- import { resolve } from 'path'
2
- import type { NuxtConfig } from '@nuxt/types'
3
- import { resolveConfig } from '../../../../src/index'
1
+ import { nuxtConfig } from '../../../../src/index'
4
2
5
- export default < NuxtConfig > resolveConfig ( {
6
- name : 'baseTheme ' ,
3
+ export default nuxtConfig ( {
4
+ name : 'BaseTheme ' ,
7
5
rootDir : __dirname ,
8
6
srcDir : __dirname ,
9
7
10
- components : [
11
- { path : resolve ( __dirname , 'components' ) , global : true }
12
- ] ,
13
-
14
8
publicRuntimeConfig : {
15
9
color : 'blue'
16
10
}
Original file line number Diff line number Diff line change 1
- import { resolve } from 'path '
1
+ import { nuxtConfig } from '../../../../src/index '
2
2
3
- export default {
4
- name : 'baseThemeEx' ,
5
- rootDir : __dirname ,
3
+ export default nuxtConfig ( {
4
+ name : 'RedTheme' ,
6
5
extends : '../base/nuxt.config' ,
7
-
8
- components : [
9
- resolve ( __dirname , 'components' )
10
- ] ,
6
+ rootDir : __dirname ,
11
7
12
8
publicRuntimeConfig : {
13
9
color : 'red'
14
10
}
15
- }
11
+ } )
Original file line number Diff line number Diff line change 1
- import { resolve } from 'path'
2
- import { resolveConfig } from '../src'
1
+ import { nuxtConfig } from '../src'
3
2
import config from './fixture/app/nuxt.config'
4
3
5
4
const scrub = ( input ) => {
@@ -24,7 +23,7 @@ const scrub = (input) => {
24
23
25
24
it ( 'fails on config being a function' , ( ) => {
26
25
const config = ( ) => ( { } )
27
- expect ( ( ) => resolveConfig ( config ) )
26
+ expect ( ( ) => nuxtConfig ( config ) )
28
27
. toThrow ( 'extending is not possible with nuxt config as a function' )
29
28
} )
30
29
You can’t perform that action at this time.
0 commit comments