Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Jan 29, 2024
1 parent 6d2c520 commit 1bcb166
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = app => {
app.config.coreMiddleware.unshift('nuxt')
app.config.coreMiddleware.unshift('nuxtTooL')
// onBeforeStart
app.beforeStart(async () => {
// try {
Expand Down
36 changes: 18 additions & 18 deletions app/extend/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ const { Nuxt, Builder } = require('nuxt')
const NUXT = Symbol('Application#nuxt')
const NUXT_BUILD = Symbol('Application#nuxtBuild')

function loadNuxtConfig(config) {
let { nuxt } = config
try {
typeof nuxt === 'string' && (nuxt = require(nuxt))
} catch (e) {
console.warn('[egg-nuxt-tool] ' + nuxt + ' nuxt config file is not exists')
nuxt = {
// srcDir: path.join(config.baseDir, './client'),
// rootDir: config.baseDir
}
console.warn('[egg-nuxt] default nuxt:', JSON.stringify(nuxt))
}
// Create development build when calling `egg-bin dev`
// nuxt.dev = config.env === 'local'
return nuxt
}
// function loadNuxtConfig(config) {
// let { nuxt } = config
// try {
// typeof nuxt === 'string' && (nuxt = require(nuxt))
// } catch (e) {
// console.warn('[egg-nuxt-tool] ' + nuxt + ' nuxt config file is not exists')
// nuxt = {
// // srcDir: path.join(config.baseDir, './client'),
// // rootDir: config.baseDir
// }
// console.warn('[egg-nuxt] default nuxt:', JSON.stringify(nuxt))
// }
// // Create development build when calling `egg-bin dev`
// // nuxt.dev = config.env === 'local'
// return nuxt
// }

// function loadNuxtConfig(config) {
// let options = config.nuxt
Expand All @@ -40,8 +40,8 @@ function loadNuxtConfig(config) {
module.exports = {
get nuxt() {
if (!this[NUXT]) {
// this[NUXT] = new Nuxt(this.config.nuxt)
this[NUXT] = new Nuxt(loadNuxtConfig(this.config))
this[NUXT] = new Nuxt(this.config.nuxt)
// this[NUXT] = new Nuxt(loadNuxtConfig(this.config))
}
return this[NUXT]
},
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "2.0.0-beta.1",
"packageManager": "[email protected]",
"eggPlugin": {
"name": "nuxt"
"name": "nuxtTooL"
},
"files": [
"app",
Expand Down

0 comments on commit 1bcb166

Please sign in to comment.