Skip to content

No JSON.stringify in define #1975

@Mister-Hope

Description

@Mister-Hope

image

  • I confirm that this is an issue rather than a question.

Bug report

index.js in plugin:

const { resolve } = require('path')

module.exports = (options, ctx) => ({
  name: 'share',

  define: {
    ShareOption: { a: 1 }
  },

  enhanceAppFiles: [resolve(__dirname, './enhanceAppFile.js')],

  globalUIComponents: 'ShareCtn'
});

// other vue files

console.log(ShareOption) // got {a:1} not '{a:1}'

Steps to reproduce

What is expected?

What is actually happening?

Other relevant information

  • Output of npx vuepress info in my VuePress project:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions