@kucrut/vite-for-wp
Advanced tools
Comparing version
{ | ||
"name": "@kucrut/vite-for-wp", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Vite integration for WordPress plugins and themes development.", | ||
@@ -22,20 +22,18 @@ "author": "Dzikri Aziz", | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.11", | ||
"@eslint/js": "^9.17.0", | ||
"@kucrut/eslint-config": "^0.3.2", | ||
"@changesets/cli": "^2.28.1", | ||
"@eslint/js": "^9.21.0", | ||
"@kucrut/eslint-config": "^0.3.3", | ||
"@types/eslint": "^9.6.1", | ||
"@types/node": "^22.10.2", | ||
"dts-buddy": "^0.5.4", | ||
"eslint": "^9.17.0", | ||
"globals": "^15.13.0", | ||
"@types/node": "^22.13.9", | ||
"dts-buddy": "^0.5.5", | ||
"eslint": "^9.21.0", | ||
"globals": "^16.0.0", | ||
"rollup-plugin-external-globals": "^0.13.0", | ||
"typescript": "5.7.2", | ||
"typescript-eslint": "^8.18.1", | ||
"vite": "^6.0.3", | ||
"vite-plugin-external": "^4.0.1" | ||
"typescript": "~5.7.3", | ||
"typescript-eslint": "^8.26.0", | ||
"vite": "^6.2.1" | ||
}, | ||
"peerDependencies": { | ||
"rollup-plugin-external-globals": "^0.13.0", | ||
"vite": "^6.0.3", | ||
"vite-plugin-external": "^4.0.1" | ||
"vite": "^6.2.1" | ||
}, | ||
@@ -45,5 +43,2 @@ "peerDependenciesMeta": { | ||
"optional": true | ||
}, | ||
"vite-plugin-external": { | ||
"optional": true | ||
} | ||
@@ -50,0 +45,0 @@ }, |
@@ -137,6 +137,6 @@ # Vite for WordPress | ||
If your package depends on one or more scripts registered by WordPress (eg. `jquery`, `react`, `@wordpress/i18n`, etc.) and you want to exclude them from the final build, add `wp_scripts()` to the list of Vite's plugins. But first, install the required dependencies: | ||
If your package depends on one or more scripts registered by WordPress (eg. `jquery`, `react`, `@wordpress/i18n`, etc.) and you want to exclude them from the final build, add `wp_scripts()` to the list of Vite's plugins. But first, install the required dependency: | ||
```sh | ||
npm add -D rollup-plugin-external-globals vite-plugin-external | ||
npm add -D rollup-plugin-external-globals | ||
``` | ||
@@ -143,0 +143,0 @@ |
@@ -19,3 +19,4 @@ import { wp_globals } from '../utils/wp-globals.js'; | ||
* @since 0.7.0 | ||
* @since 0.8.0 Import dependencies dynamically. | ||
* @since 0.8.0 Import dependencies dynamically. | ||
* @since 0.11.0 Remove vite-plugin-external dependency. | ||
* | ||
@@ -27,4 +28,3 @@ * @type {(options?: WPScriptsOptions) => Plugin} | ||
export async function wp_scripts( options = {} ) { | ||
const { default: externals } = await import( 'vite-plugin-external' ); | ||
const { default: globals } = await import( 'rollup-plugin-external-globals' ); | ||
const { default: external_globals } = await import( 'rollup-plugin-external-globals' ); | ||
@@ -59,7 +59,4 @@ const { extraScripts = {} } = options; | ||
plugin, | ||
externals( { | ||
externals: scripts, | ||
} ), | ||
globals( scripts ), | ||
external_globals( scripts ), | ||
]; | ||
} |
2
-33.33%12
-7.69%36378
-0.55%412
-0.72%