Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
fix: fix _routeHelper is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Apr 1, 2024
1 parent 2b7e7b6 commit b5a50e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/karbon/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ tasks:
POLYFILL_CRYPTO: 'true'
platform: node
inputs:
- tsup.config.ts
- '@group(sources)'
outputs:
- bin/**/*
Expand All @@ -47,6 +48,7 @@ tasks:
- dist/helper.mjs
platform: node
inputs:
- tsup.config.ts
- 'dist/helper.mjs'
outputs:
- 'dist/helper.mjs'
Expand All @@ -59,6 +61,7 @@ tasks:
- dist/module.mjs
platform: node
inputs:
- tsup.config.ts
- 'dist/module.mjs'
outputs:
- 'dist/module.mjs'
Expand Down
3 changes: 3 additions & 0 deletions packages/karbon/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const karbon = defineNuxtModule<ModuleOptions>({

nuxt.options.alias ??= {}
nuxt.options.alias['@storipress/sdk'] = resolver.resolve('.')
nuxt.options.alias['@storipress/karbon/route-helper'] = resolver.resolve('./route-helper')

nuxt.options.runtimeConfig.storipress = {
// @ts-expect-error default
Expand Down Expand Up @@ -317,6 +318,8 @@ const karbon = defineNuxtModule<ModuleOptions>({
const userPath = await resolvePath(isViewablePath)
nuxt.hook('nitro:config', async (nitroConfig) => {
nitroConfig.virtual!['#sp-internal/storipress-urls.mjs'] = () => serializedURLs
nitroConfig.alias ??= {}
nitroConfig.alias['@storipress/karbon/route-helper'] = resolver.resolve('./route-helper')

const resolvedIsViewable = fs.existsSync(userPath)
? userPath
Expand Down
2 changes: 1 addition & 1 deletion packages/karbon/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['./src/cli/enter.ts'],
target: 'node16',
target: 'node18',
format: 'esm',
esbuildOptions(options) {
options.allowOverwrite = true
Expand Down

0 comments on commit b5a50e5

Please sign in to comment.