Static GitHub Issues

[1456] Access the mode property from inside a plugin?

prev: render empty page when <nuxt/> has brother dom.
next: Error building project since version 1.0rc

Is this possible? I'd like to check if the build is running in spa mode inside /plugins/.

And also, would it make a difference if mode is set via nuxt.config.js or via cli argument?

// nuxt.config.js

module.exports = {
  mode: 'spa' // or 'universal'
}

vs

// package.json
...

"scripts" : {
   "build" : "nuxt build --spa"
}

...

And then in a plugin (ie: /plugins/my-plugin.js

// my-plugin.js

// not working, but example
const mode = options.mode  // 'spa' or 'universal'
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1296">#c1296</a>)</em></sub></div>