Skip to content

Commit

Permalink
fix: error when installing in nuxt #110
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyf committed May 31, 2024
1 parent 2ea25bb commit bd40b15
Show file tree
Hide file tree
Showing 7 changed files with 3,966 additions and 9,306 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

strategy:
matrix:
node: [16.x, 18.x]
node: [18.x]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x

- run: npx changelogithub
env:
Expand Down
18 changes: 7 additions & 11 deletions packages/vue3-pixi-nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { addComponent, addImports, createResolver, defineNuxtModule } from '@nux
import * as core from 'vue3-pixi'
import { isCustomElement } from 'vue3-pixi'

const resolver = createResolver(import.meta.url)

const components = [
'Application',
'PixiTransition',
Expand All @@ -19,23 +17,21 @@ export interface ModuleOptions {}
export default defineNuxtModule({
meta: { name: 'vue3-pixi-nuxt' },
async setup(options, nuxt) {
const resolver = createResolver(import.meta.url)
for (const name of components) {
addComponent({
name,
filePath: 'vue3-pixi',
export: name,
mode: 'client',
_raw: true,
})
addComponent({
name,
filePath: name === 'Application'
? resolver.resolve('./runtime/ServerApplication.vue')
: resolver.resolve('./runtime/ServerEmpty.vue'),
mode: 'server',
})
}

addComponent({
name: 'Application',
filePath: resolver.resolve('./runtime/Application.server.vue'),
mode: 'server',
})

for (const name in core) {
if (name.match(/^use/) || name.match(/^on[A-Z]{1}/)) {
addImports({
Expand Down
3 changes: 0 additions & 3 deletions packages/vue3-pixi-nuxt/src/runtime/ServerEmpty.vue

This file was deleted.

Loading

0 comments on commit bd40b15

Please sign in to comment.