We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
At vite5 manifest file is located at /dist/.vite directory.
So this code does not work.
add_action( 'wp_enqueue_scripts', function (): void { Vite\enqueue_asset( __DIR__ . '/dist', 'assets/main.js', [ 'handle' => 'my-script-handle', 'dependencies' => ['jquery'], // Optional script dependencies. Defaults to empty array. 'css-dependencies' => [], // Optional style dependencies. Defaults to empty array. 'css-media' => 'all', // Optional. 'css-only' => false, // Optional. Set to true to only load style assets in production mode. 'in-footer' => true, // Optional. Defaults to false. ] ); } );
And I think
/** * Load production asset * * @since 0.1.0 * * @param object $manifest Asset manifest. * @param string $entry Entrypoint to enqueue. * @param array $options Enqueue options. * * @return array|null Array containing registered scripts & styles or NULL if there was an error. */ function load_production_asset( object $manifest, string $entry, array $options ): ?array { $url = prepare_asset_url( $manifest->dir );
So I think that asset_url and manifest->dir should be distinct.
By the way, I really like your project. Thanks.
The text was updated successfully, but these errors were encountered:
You can append this to plugins array in vite.config.ts to use the old style path.
plugins
vite.config.ts
{ name: 'override-config', config: () => ({ build: { // ensure that manifest.json is not in ".vite/" folder manifest: 'manifest.json', }, }), }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
At vite5 manifest file is located at /dist/.vite directory.
So this code does not work.
And I think
So I think that asset_url and manifest->dir should be distinct.
By the way, I really like your project. Thanks.
The text was updated successfully, but these errors were encountered: