diff --git a/src/index.ts b/src/index.ts index 1b9722e..3c27b44 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,9 +54,7 @@ export default function laravel(config: string|string[]|PluginConfig): LaravelPl let resolvedConfig: ResolvedConfig const cssManifest: Manifest = {} - const ziggy = 'vendor/tightenco/ziggy/dist/index.es.js'; const defaultAliases: Record = { - ...(fs.existsSync(ziggy) ? { ziggy } : undefined), '@': '/resources/js', }; diff --git a/tests/index.test.ts b/tests/index.test.ts index f15f400..0ec23d7 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,6 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import laravel from '../src' -import fs from 'fs' describe('laravel-vite-plugin', () => { afterEach(() => { @@ -169,30 +168,6 @@ describe('laravel-vite-plugin', () => { ]) }) - it('provides an ziggy alias when installed', () => { - vi.spyOn(fs, 'existsSync').mockReturnValueOnce(true) - - const plugin = laravel('resources/js/app.js') - - const config = plugin.config({}, { command: 'build', mode: 'development' }) - - expect(config.resolve.alias['ziggy']).toBe('vendor/tightenco/ziggy/dist/index.es.js') - }) - - it('provides an ziggy alias when installed and using an alias array', () => { - vi.spyOn(fs, 'existsSync').mockReturnValueOnce(true) - - const plugin = laravel('resources/js/app.js') - - const config = plugin.config({ - resolve: { - alias: [], - } - }, { command: 'build', mode: 'development' }) - - expect(config.resolve.alias).toContainEqual({ find: 'ziggy', replacement: 'vendor/tightenco/ziggy/dist/index.es.js' }) - }) - it('configures the Vite server when inside a Sail container', () => { process.env.LARAVEL_SAIL = '1' const plugin = laravel('resources/js/app.js')