Skip to content

Commit 84f3f78

Browse files
authored
Merge pull request #21 from laravel/remove-ziggy-alias
remove ziggy alias
2 parents 9671bd7 + 16d61a8 commit 84f3f78

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ export default function laravel(config: string|string[]|PluginConfig): LaravelPl
5454
let resolvedConfig: ResolvedConfig
5555
const cssManifest: Manifest = {}
5656

57-
const ziggy = 'vendor/tightenco/ziggy/dist/index.es.js';
5857
const defaultAliases: Record<string, string> = {
59-
...(fs.existsSync(ziggy) ? { ziggy } : undefined),
6058
'@': '/resources/js',
6159
};
6260

tests/index.test.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { afterEach, describe, expect, it, vi } from 'vitest'
22
import laravel from '../src'
3-
import fs from 'fs'
43

54
describe('laravel-vite-plugin', () => {
65
afterEach(() => {
@@ -169,30 +168,6 @@ describe('laravel-vite-plugin', () => {
169168
])
170169
})
171170

172-
it('provides an ziggy alias when installed', () => {
173-
vi.spyOn(fs, 'existsSync').mockReturnValueOnce(true)
174-
175-
const plugin = laravel('resources/js/app.js')
176-
177-
const config = plugin.config({}, { command: 'build', mode: 'development' })
178-
179-
expect(config.resolve.alias['ziggy']).toBe('vendor/tightenco/ziggy/dist/index.es.js')
180-
})
181-
182-
it('provides an ziggy alias when installed and using an alias array', () => {
183-
vi.spyOn(fs, 'existsSync').mockReturnValueOnce(true)
184-
185-
const plugin = laravel('resources/js/app.js')
186-
187-
const config = plugin.config({
188-
resolve: {
189-
alias: [],
190-
}
191-
}, { command: 'build', mode: 'development' })
192-
193-
expect(config.resolve.alias).toContainEqual({ find: 'ziggy', replacement: 'vendor/tightenco/ziggy/dist/index.es.js' })
194-
})
195-
196171
it('configures the Vite server when inside a Sail container', () => {
197172
process.env.LARAVEL_SAIL = '1'
198173
const plugin = laravel('resources/js/app.js')

0 commit comments

Comments
 (0)