Socket
Socket
Sign inDemoInstall

laravel-vite-plugin

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravel-vite-plugin

Laravel plugin for Vite.


Version published
Weekly downloads
314K
increased by0.27%
Maintainers
1
Weekly downloads
 
Created

What is laravel-vite-plugin?

The laravel-vite-plugin npm package is designed to integrate Vite with Laravel applications. It provides a seamless way to manage and build frontend assets using Vite's fast and modern build tool, while leveraging Laravel's backend capabilities.

What are laravel-vite-plugin's main functionalities?

Vite Configuration

This feature allows you to configure Vite to work with Laravel. The code sample shows how to define the Vite configuration and use the laravel-vite-plugin to specify the input files and enable hot module replacement.

```javascript
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
  plugins: [
    laravel({
      input: ['resources/css/app.css', 'resources/js/app.js'],
      refresh: true,
    }),
  ],
});
```

Hot Module Replacement (HMR)

This feature enables Hot Module Replacement (HMR) for a better development experience. The code sample shows how to configure the Vite server to use HMR with the laravel-vite-plugin.

```javascript
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
  plugins: [
    laravel({
      input: ['resources/css/app.css', 'resources/js/app.js'],
      refresh: true,
    }),
  ],
  server: {
    hmr: {
      host: 'localhost',
    },
  },
});
```

Asset Versioning

This feature allows for asset versioning, which helps in cache busting. The code sample shows how to enable the generation of a manifest file during the build process, which can be used for versioning assets.

```javascript
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
  plugins: [
    laravel({
      input: ['resources/css/app.css', 'resources/js/app.js'],
      refresh: true,
    }),
  ],
  build: {
    manifest: true,
  },
});
```

Other packages similar to laravel-vite-plugin

Keywords

FAQs

Package last updated on 09 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc