In ~plugins/test.js
:
import store from '~store'
const store2 = require('~store')
console.log(store)
console.log(store2)
output:
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: