File tree Expand file tree Collapse file tree 5 files changed +125
-258
lines changed Expand file tree Collapse file tree 5 files changed +125
-258
lines changed Original file line number Diff line number Diff line change 11module . exports = {
2- type : 'host' ,
32 layout : 'now' ,
43 zh : 'nut compose' ,
54 router : {
Original file line number Diff line number Diff line change @@ -8,17 +8,10 @@ const StatsWriterPlugin = require( 'webpack-stats-plugin' ).StatsWriterPlugin
88const dirs = require ( '../utils/dirs' )
99
1010exports . normal = function ( config , nutConfig ) {
11- if ( nutConfig . type === 'host' ) {
12- config
13- . entry ( 'index' )
14- . add ( path . join ( dirs . runtime , 'entries/host.js' ) )
15- . end ( )
16- } else {
17- config
18- . entry ( 'index' )
19- . add ( path . join ( dirs . runtime , 'entries/single.js' ) )
20- . end ( )
21- }
11+ config
12+ . entry ( 'index' )
13+ . add ( path . join ( dirs . runtime , 'entries/default.js' ) )
14+ . end ( )
2215
2316 let templatePath
2417
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import routes from '@/nut-auto-generated-routes'
1515import pluginOptions from '@/nut-auto-generated-plugin-options'
1616import config from '@/nut-auto-generated-config'
1717
18+ import applyCompose from '../steps/apply-compose'
1819import applyPlugins from '../steps/apply-plugins'
1920import setupNico from '../steps/setup-nico'
2021import registerLayouts from '../steps/register-layouts'
@@ -31,6 +32,12 @@ import events from '../context/events'
3132import use from '../context/use'
3233
3334; ( async function ( ) {
35+ if ( nutConfig . compose ) {
36+ const composed = await applyCompose ( nutConfig . compose )
37+ pages . push ( ...composed . pages )
38+ routes . push ( ...composed . routes )
39+ }
40+
3441 const routerOptions = nutConfig . router || { }
3542 const router = createRouter ( routerOptions )
3643
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments