global name is wrongly set to nuxt-edge (#6736)

[release]
This commit is contained in:
Xin Du (Clark) 2019-11-27 19:51:48 +00:00 committed by Pooya Parsa
parent e8aca9eb11
commit 75a29c8b13
5 changed files with 8 additions and 7 deletions

View File

@ -15,7 +15,8 @@ module.exports = {
}, },
rules: { rules: {
'no-console': 'error', 'no-console': 'error',
'no-debugger': 'error' 'no-debugger': 'error',
quotes: ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }]
}, },
overrides: [{ overrides: [{
files: [ 'test/fixtures/*/.nuxt*/**' ], files: [ 'test/fixtures/*/.nuxt*/**' ],

View File

@ -12,8 +12,7 @@ export default () => ({
mode: 'universal', mode: 'universal',
modern: undefined, modern: undefined,
// Globals globalName: undefined,
globalName: 'nuxt',
globals: { globals: {
id: globalName => `__${globalName}`, id: globalName => `__${globalName}`,
nuxt: globalName => `$${globalName}`, nuxt: globalName => `$${globalName}`,

View File

@ -63,7 +63,8 @@ export function getNuxtConfig (_options) {
options.globalName = (isNonEmptyString(options.globalName) && /^[a-zA-Z]+$/.test(options.globalName)) options.globalName = (isNonEmptyString(options.globalName) && /^[a-zA-Z]+$/.test(options.globalName))
? options.globalName.toLowerCase() ? options.globalName.toLowerCase()
: 'nuxt' // use `` for preventing replacing to nuxt-edge
: `nuxt`
// Resolve rootDir // Resolve rootDir
options.rootDir = isNonEmptyString(options.rootDir) ? path.resolve(options.rootDir) : process.cwd() options.rootDir = isNonEmptyString(options.rootDir) ? path.resolve(options.rootDir) : process.cwd()

View File

@ -177,7 +177,7 @@ Object {
"routes": Array [], "routes": Array [],
"subFolders": true, "subFolders": true,
}, },
"globalName": "nuxt", "globalName": undefined,
"globals": Object { "globals": Object {
"context": [Function], "context": [Function],
"id": [Function], "id": [Function],
@ -531,7 +531,7 @@ Object {
"routes": Array [], "routes": Array [],
"subFolders": true, "subFolders": true,
}, },
"globalName": "nuxt", "globalName": undefined,
"globals": Object { "globals": Object {
"context": [Function], "context": [Function],
"id": [Function], "id": [Function],