Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
vite-plugin-symfony
Advanced tools
A Vite plugin to integrate easily Vite in your Symfony application..
A Vite plugin to integrate easily Vite in your Symfony application..
entrypoints.json
file inside your build directory with your js/css/preload dependencies.This package is intended for use with the Symfony Bundle : pentatrion/vite-bundle.
npm i vite-plugin-symfony
Create this directory structure :
├──assets
│ ├──app.js
│ ├──app.css
│...
├──public
├──composer.json
├──package.json
├──vite.config.js
Vite base config with vite 3.x
// vite.config.js
import {defineConfig} from "vite";
import symfonyPlugin from "vite-plugin-symfony";
/* if you're using React */
// import reactRefresh from "@vitejs/plugin-react-refresh";
export default defineConfig({
plugins: [
/* reactRefresh(), // if you're using React */
symfonyPlugin({
/* defaultValues */
servePublic: true,
publicDirectory: 'public',
buildDirectory: 'build',
/* boolean or array of paths for your twig templates */
refresh: ["templates/**/*.twig"]
/** If you set server.host: '0.0.0.0' in your vite.config.js
* you have to set 'localhost' */
viteDevServerHostname: null
}),
],
build: {
rollupOptions: {
input: {
app: "./assets/app.js" /* relative to the root option */
},
},
}
});
and your package.json :
{
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"vite": "^3.0",
"vite-plugin-symfony": "^0.6.0"
}
}
From the options publicDirectory
and buildDirectory
, vite-plugin-symfony
will automatically determine the right configuration for vite
:
base
build.outDir
If you have a specific need you can still define your configuration on top.
Although it has no special dependencies, this package is intended for use with the Symfony Bundle : pentatrion/vite-bundle. This bundle provides two twig functions to load your js/css files into your templates. It also acts as a proxy by forwarding requests that are not intended for it to the Vite dev server.
If you use previous version of the plugin consult migration page.
v0.6.2
viteDevServerHost
plugin optionFAQs
A Vite plugin to integrate easily Vite in your Symfony application
The npm package vite-plugin-symfony receives a total of 11,464 weekly downloads. As such, vite-plugin-symfony popularity was classified as popular.
We found that vite-plugin-symfony demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.