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: {
'no-console': 'error',
'no-debugger': 'error'
'no-debugger': 'error',
quotes: ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }]
},
overrides: [{
files: [ 'test/fixtures/*/.nuxt*/**' ],

View File

@ -12,8 +12,7 @@ export default () => ({
mode: 'universal',
modern: undefined,
// Globals
globalName: 'nuxt',
globalName: undefined,
globals: {
id: 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.toLowerCase()
: 'nuxt'
// use `` for preventing replacing to nuxt-edge
: `nuxt`
// Resolve rootDir
options.rootDir = isNonEmptyString(options.rootDir) ? path.resolve(options.rootDir) : process.cwd()

View File

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

View File

@ -4,7 +4,7 @@ import consola from 'consola'
import Package from './package.js'
async function main() {
async function main () {
// Read package at current directory
const rootPackage = new Package()
const workspacePackages = await rootPackage.getWorkspacePackages()