Home

Issue: 1120

Can't import/require store from plugin

[issue link]

In ~plugins/test.js:

import store from '~store'
const store2 = require('~store')

console.log(store)
console.log(store2)

output:

screen shot 2017-07-19 at 19 44 04

How I can access store from plugin or any other place that is not a component/page/layout?
Note: exactly the same happens with '~router'.

Nuxt 1.0.0-alpha.4

According to docs it should work:

screen shot 2017-07-19 at 19 48 37

This question is available on Nuxt.js community (#c978)