Skip to content

Commit

Permalink
Merge pull request #95 from timacdonald/do-not-externalise-helpers
Browse files Browse the repository at this point in the history
Do not externalise inertia helpers
  • Loading branch information
jessarcher committed Jul 20, 2022
2 parents a766dd5 + 2d15680 commit 8d2923b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -360,7 +360,7 @@ function noExternalInertiaHelpers(config: UserConfig): true|Array<string|RegExp>
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
/* @ts-ignore */
const userNoExternal = (config.ssr as SSROptions|undefined)?.noExternal
const pluginNoExternal = ['laravel-vite-plugin/inertia-helpers']
const pluginNoExternal = ['laravel-vite-plugin']

if (userNoExternal === true) {
return true
Expand Down
6 changes: 3 additions & 3 deletions tests/index.test.ts
Expand Up @@ -219,7 +219,7 @@ describe('laravel-vite-plugin', () => {

const noSsrConfig = plugin.config({ build: { ssr: true } }, { command: 'build', mode: 'production' })
/* @ts-ignore */
expect(noSsrConfig.ssr.noExternal).toEqual(['laravel-vite-plugin/inertia-helpers'])
expect(noSsrConfig.ssr.noExternal).toEqual(['laravel-vite-plugin'])

/* @ts-ignore */
const nothingExternalConfig = plugin.config({ ssr: { noExternal: true }, build: { ssr: true } }, { command: 'build', mode: 'production' })
Expand All @@ -229,12 +229,12 @@ describe('laravel-vite-plugin', () => {
/* @ts-ignore */
const arrayNoExternalConfig = plugin.config({ ssr: { noExternal: ['foo'] }, build: { ssr: true } }, { command: 'build', mode: 'production' })
/* @ts-ignore */
expect(arrayNoExternalConfig.ssr.noExternal).toEqual(['foo', 'laravel-vite-plugin/inertia-helpers'])
expect(arrayNoExternalConfig.ssr.noExternal).toEqual(['foo', 'laravel-vite-plugin'])

/* @ts-ignore */
const stringNoExternalConfig = plugin.config({ ssr: { noExternal: 'foo' }, build: { ssr: true } }, { command: 'build', mode: 'production' })
/* @ts-ignore */
expect(stringNoExternalConfig.ssr.noExternal).toEqual(['foo', 'laravel-vite-plugin/inertia-helpers'])
expect(stringNoExternalConfig.ssr.noExternal).toEqual(['foo', 'laravel-vite-plugin'])
})

it('does not configure full reload when configuration it not an object', () => {
Expand Down

0 comments on commit 8d2923b

Please sign in to comment.