vite-plugin-symfony
Advanced tools
Comparing version 6.4.3 to 6.4.4
@@ -58,3 +58,2 @@ var __create = Object.create; | ||
var import_path = require("path"); | ||
var import_path2 = require("path"); | ||
var import_node_crypto = require("crypto"); | ||
@@ -83,12 +82,2 @@ | ||
} | ||
function isSubdirectory(parent, child) { | ||
parent = import_node_path.default.normalize(parent); | ||
child = import_node_path.default.normalize(child); | ||
if (parent == child) { | ||
return false; | ||
} | ||
const parentDirs = parent.split(import_node_path.default.sep).filter((dir) => dir !== ""); | ||
const childDirs = child.split(import_node_path.default.sep).filter((dir) => dir !== ""); | ||
return parentDirs.every((dir, i) => childDirs[i] === dir); | ||
} | ||
function normalizePath(id) { | ||
@@ -98,3 +87,3 @@ return import_node_path.default.posix.normalize(isWindows ? slash(id) : id); | ||
function getLegacyName(name) { | ||
const ext = (0, import_path2.extname)(name); | ||
const ext = (0, import_path.extname)(name); | ||
const endPos = ext.length !== 0 ? -ext.length : void 0; | ||
@@ -118,8 +107,2 @@ name = name.slice(0, endPos) + "-legacy" + ext; | ||
}; | ||
var emptyDir = (dir) => { | ||
const files = (0, import_fs.readdirSync)(dir); | ||
for (const file of files) { | ||
(0, import_fs.rmSync)((0, import_path.join)(dir, file), { recursive: true }); | ||
} | ||
}; | ||
var FS_PREFIX = `/@fs/`; | ||
@@ -220,6 +203,6 @@ var VALID_ID_PREFIX = `/@id/`; | ||
for (const [entryName, inputRelPath] of Object.entries(config.build.rollupOptions.input)) { | ||
const entryAbsolutePath = normalizePath((0, import_path2.resolve)(config.root, inputRelPath)); | ||
const extension = (0, import_path2.extname)(inputRelPath); | ||
const entryAbsolutePath = normalizePath((0, import_path.resolve)(config.root, inputRelPath)); | ||
const extension = (0, import_path.extname)(inputRelPath); | ||
const inputType = [".css", ".scss", ".sass", ".less", ".styl", ".stylus", ".postcss"].indexOf(extension) !== -1 ? "css" : "js"; | ||
const entryRelativePath = normalizePath((0, import_path2.relative)(config.root, entryAbsolutePath)); | ||
const entryRelativePath = normalizePath((0, import_path.relative)(config.root, entryAbsolutePath)); | ||
inputParsed[entryName] = { | ||
@@ -599,8 +582,2 @@ inputType, | ||
const entryPointsPath = (0, import_node_path3.resolve)(viteConfig.root, viteConfig.build.outDir, entryPointsFileName); | ||
if (!isSubdirectory(viteConfig.root, buildDir) && viteConfig.build.emptyOutDir !== true) { | ||
logger.error( | ||
`outDir ${buildDir} is not a subDirectory of your project root. To prevent recursively deleting files anywhere else set "build.outDir" to true in your vite.config.js to confirm that you did not accidentally specify a wrong directory location.` | ||
); | ||
import_node_process2.default.exit(1); | ||
} | ||
if (!isAddressInfo(address)) { | ||
@@ -615,3 +592,2 @@ logger.error( | ||
} | ||
(0, import_node_fs.existsSync)(buildDir) && emptyDir(buildDir); | ||
(0, import_node_fs.mkdirSync)(viteDir, { recursive: true }); | ||
@@ -618,0 +594,0 @@ viteDevServerUrl = resolveDevServerUrl(address, devServer.config, pluginOptions); |
{ | ||
"name": "vite-plugin-symfony", | ||
"version": "6.4.3", | ||
"version": "6.4.4", | ||
"description": "A Vite plugin to integrate easily Vite in your Symfony application", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -16,3 +16,3 @@ <div> | ||
A Vite plugin to integrate easily Vite in your Symfony application.. | ||
A Vite plugin to easily integrate Vite into your Symfony application. | ||
@@ -96,2 +96,2 @@ - create a `entrypoints.json` file inside your build directory with your js/css/preload dependencies. | ||
[MIT](LICENSE). | ||
[MIT](LICENSE). |
@@ -18,3 +18,2 @@ import { resolve, join, relative, dirname } from "node:path"; | ||
writeJson, | ||
emptyDir, | ||
isImportRequest, | ||
@@ -28,3 +27,2 @@ isInternalRequest, | ||
parseVersionString, | ||
isSubdirectory, | ||
extractExtraEnvVars, | ||
@@ -153,10 +151,2 @@ } from "./utils"; | ||
// buildDir is not a subdirectory of the vite project root -> potentially dangerous | ||
if (!isSubdirectory(viteConfig.root, buildDir) && viteConfig.build.emptyOutDir !== true) { | ||
logger.error( | ||
`outDir ${buildDir} is not a subDirectory of your project root. To prevent recursively deleting files anywhere else set "build.outDir" to true in your vite.config.js to confirm that you did not accidentally specify a wrong directory location.`, | ||
); | ||
process.exit(1); | ||
} | ||
if (!isAddressInfo(address)) { | ||
@@ -173,4 +163,2 @@ logger.error( | ||
existsSync(buildDir) && emptyDir(buildDir); | ||
mkdirSync(viteDir, { recursive: true }); | ||
@@ -177,0 +165,0 @@ |
@@ -24,12 +24,8 @@ import "rollup"; | ||
export type EntryPointsFile = { | ||
viteServer: | ||
| { | ||
origin: string; | ||
base: string; | ||
} | ||
| false; | ||
base: string; | ||
entryPoints: EntryPoints; | ||
assets: StringMapping; | ||
legacy: boolean; | ||
metadatas: FileMetadatas; | ||
version: [string, number, number, number]; | ||
viteServer: string | null; | ||
}; | ||
@@ -74,2 +70,3 @@ | ||
src?: string; | ||
isDynamicEntry?: boolean; | ||
isEntry?: boolean; | ||
@@ -80,3 +77,3 @@ imports?: string[]; | ||
export type Manifest = { | ||
export type ManifestFile = { | ||
[k: string]: ManifestEntry; | ||
@@ -83,0 +80,0 @@ }; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96
217579
4468