Skip to content

Pinia with Vue 2.7 and router example #2416

Closed Answered by MarcelGeo
MarcelGeo asked this question in Help and Questions
Discussion options

You must be logged in to vote

Hi. After hours of debugging. There are rules for using pinia, router and vue 2.7 in monorepo worksapces:

  • properly remove pinia dependency from libraries bundle
rollupOptions: {    
 // make sure to externalize deps that shouldn't be bundled     
// into your library     
  external: ['vue', 'pinia', ...Object.keys(packageJson.dependencies)],     
  output: {       
    exports: 'named',       
    // Provide global variables to use in the UMD build       
    // for externalized deps       
    globals: {        
        vue: 'Vue',         
        pinia: 'pinia'       
    }    
 },
  • use dedupe (maybe helping for something :) )

  • router have to be created before mounting with $mount…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@MarcelGeo
Comment options

@MarcelGeo
Comment options

@MarcelGeo
Comment options

@MarcelGeo
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MarcelGeo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants