Skip to content

Commit

Permalink
fix(nuxt): correct build export
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Nov 4, 2021
1 parent 0306722 commit b2229cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/nuxt/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export default defineBuildConfig({
declaration: true,
emitCJS: false,
cjsBridge: true,
entries: ['src/module'],
entries: ['src/module', 'src/templates/plugin'],
externals: ['pinia', '@nuxt/kit-edge', '@nuxt/types'],
})
7 changes: 2 additions & 5 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,15 @@
"import": "./dist/module.mjs",
"require": "./module.cjs"
},
"./dist/templates/*": "./dist/templates/*",
"./templates/*": "./dist/templates/*"
"./dist/*": "./dist/*"
},
"main": "./module.cjs",
"types": "./dist/module.d.ts",
"files": [
"module.cjs",
"dist/*.js",
"dist/*.mjs",
"dist/*.d.ts",
"dist/templates/*.js",
"dist/templates/*.mjs"
"dist/*.d.ts"
],
"scripts": {
"build": "unbuild",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const module = defineNuxtModule<PiniaNuxtOptions>({
// but doesn't have the type: module in its packages.json file
nuxt.options.alias.pinia = 'pinia/dist/pinia.mjs'

addPlugin({ src: require.resolve('./templates/plugin.mjs') })
addPlugin({ src: require.resolve('./plugin.mjs') })

// transpile pinia for nuxt 2 and nuxt bridge
if (isVue2 && !nuxt.options.build.transpile.includes('pinia')) {
Expand Down

0 comments on commit b2229cc

Please sign in to comment.