From 47030934bdf1e4ae1ef80be16131e26a1e68def5 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Fri, 17 Jun 2022 16:37:05 +1000 Subject: [PATCH 1/2] remove ziggy alias --- src/index.ts | 2 -- tests/index.test.ts | 24 ------------------------ 2 files changed, 26 deletions(-) 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..bc59ae9 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -169,30 +169,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') From 16d61a8fa78c647ff91816a05fbf4ed86ab73ae3 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Fri, 17 Jun 2022 16:55:54 +1000 Subject: [PATCH 2/2] remove unused import --- tests/index.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/index.test.ts b/tests/index.test.ts index bc59ae9..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(() => {