How can I use the store of Pinia in the child VueJS application #1753
Answered
by
Giildo
Giildo
asked this question in
Help and Questions
-
Beta Was this translation helpful? Give feedback.
Answered by
Giildo
Oct 26, 2022
Replies: 1 comment
-
I found the solution to reddit. If you build a library with Pina, in the export default defineConfig({
//...
build: {
commonjsOptions: {
esmExternals: true,
},
lib: {
entry: resolve(__dirname, 'src/main.ts'),
name: 'Formbuilder',
fileName: 'formbuilder-plugin',
},
rollupOptions: {
external: ['vue', 'pinia'],
output: {
globals: {
vue: 'Vue',
pinia: 'pinia',
},
},
},
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Giildo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found the solution to reddit. If you build a library with Pina, in the
vite.config.ts
file you have to addPinia
option in therollupOptions
inexternal
&globals
: