vite-plugin-utils
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.singlelineCommentsRE = exports.multilineCommentsRE = exports.KNOWN_ASSET_TYPES = exports.KNOWN_SFC_EXTENSIONS = exports.DEFAULT_EXTENSIONS = void 0; | ||
// https://github.com/vitejs/vite/blob/c3f6731bafeadd310efa4325cb8dcc639636fe48/packages/vite/src/node/constants.ts#L25-L33 | ||
exports.DEFAULT_EXTENSIONS = [ | ||
export const DEFAULT_EXTENSIONS = [ | ||
'.mjs', | ||
@@ -14,3 +11,3 @@ '.js', | ||
]; | ||
exports.KNOWN_SFC_EXTENSIONS = [ | ||
export const KNOWN_SFC_EXTENSIONS = [ | ||
'.vue', | ||
@@ -20,3 +17,3 @@ '.svelte', | ||
// https://github.com/vitejs/vite/blob/c3f6731bafeadd310efa4325cb8dcc639636fe48/packages/vite/src/node/constants.ts#L91-L123 | ||
exports.KNOWN_ASSET_TYPES = [ | ||
export const KNOWN_ASSET_TYPES = [ | ||
// images | ||
@@ -51,3 +48,3 @@ 'png', | ||
]; | ||
exports.multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//gm; | ||
exports.singlelineCommentsRE = /\/\/.*/g; | ||
export const multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//gm; | ||
export const singlelineCommentsRE = /\/\/.*/g; |
@@ -32,1 +32,2 @@ export declare function cleanUrl(url: string): string; | ||
} | ||
export declare function normalizePath(id: string): string; |
@@ -1,5 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.walk = exports.relativeify = exports.MagicString = exports.cleanUrl = void 0; | ||
function cleanUrl(url) { | ||
import path from 'node:path'; | ||
import os from 'node:os'; | ||
export function cleanUrl(url) { | ||
const queryRE = /\?.*$/s; | ||
@@ -9,7 +8,6 @@ const hashRE = /#.*$/s; | ||
} | ||
exports.cleanUrl = cleanUrl; | ||
/** | ||
* @see https://github.com/rich-harris/magic-string | ||
*/ | ||
class MagicString { | ||
export class MagicString { | ||
constructor(str) { | ||
@@ -50,3 +48,2 @@ this.str = str; | ||
} | ||
exports.MagicString = MagicString; | ||
/** | ||
@@ -56,3 +53,3 @@ * - `'' -> '.'` | ||
*/ | ||
function relativeify(relative) { | ||
export function relativeify(relative) { | ||
if (relative === '') { | ||
@@ -66,7 +63,6 @@ return '.'; | ||
} | ||
exports.relativeify = relativeify; | ||
/** | ||
* Ast tree walk | ||
*/ | ||
async function walk(ast, visitors) { | ||
export async function walk(ast, visitors) { | ||
var _a; | ||
@@ -87,3 +83,2 @@ if (!ast) | ||
} | ||
exports.walk = walk; | ||
walk.sync = function walkSync(ast, visitors) { | ||
@@ -105,1 +100,8 @@ var _a; | ||
}; | ||
const isWindows = os.platform() === 'win32'; | ||
function slash(p) { | ||
return p.replace(/\\/g, '/'); | ||
} | ||
export function normalizePath(id) { | ||
return path.posix.normalize(isWindows ? slash(id) : id); | ||
} |
{ | ||
"name": "vite-plugin-utils", | ||
"description": "A collection of opinionated Vite plugin utils", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"type": "module", | ||
"main": "", | ||
@@ -6,0 +7,0 @@ "repository": { |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sort = exports.OfficialPlugins = void 0; | ||
exports.OfficialPlugins = { | ||
export const OfficialPlugins = { | ||
'@vitejs/plugin-vue': 'vite:vue', | ||
@@ -18,3 +15,3 @@ 'vite-plugin-vue2': 'vite-plugin-vue2', | ||
*/ | ||
function sort(options) { | ||
export function sort(options) { | ||
const { plugin, names, enforce } = options; | ||
@@ -71,2 +68,1 @@ const name = `${plugin.name}:sorter`; | ||
} | ||
exports.sort = sort; |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22149
10
625
0
Yes
1