PluginProbe
Pay with Vipps and MobilePay for WooCommerce / 6.0.5
Pay with Vipps and MobilePay for WooCommerce v6.0.5
6.2.2 6.2.1 6.2.0 6.1.10 6.1.9 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1.0 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 5.4.3 5.4.2 5.4.1 5.4.0 5.3.4 All 184 releases
woo-vipps / payment / src / admin / settings / vite.config.ts

vite.config.ts in Pay with Vipps and MobilePay for WooCommerce 6.0.5, at payment/src/admin/settings/vite.config.ts

36 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { defineConfig, esmExternalRequirePlugin } from 'vite';
2 import react from '@vitejs/plugin-react';
3
4 // https://vitejs.dev/config/
5 export default defineConfig({
6 plugins: [react({
7 // Disable automatic runtime injection
8 jsxRuntime: 'classic',
9 }),
10 esmExternalRequirePlugin({
11 external: ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime'],
12 }),
13
14
15 ],
16 build: {
17 rolldownOptions: {
18 external: ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime'],
19 output: {
20 format: "iife", // or "umd"
21 globals: { // Ensure we can load react from WP
22 react: 'wp.element',
23 'react-dom': 'wp.element',
24 'react-dom/client': 'wp.element',
25 'react-dom/jsx-runtime': 'wp.element',
26 },
27 dir: '../../../admin/settings/dist',
28 // Necessary to have a consistent output path, so it's easy to reference it when we call wp_enqueue_script().
29 entryFileNames: 'plugin.js',
30 chunkFileNames: 'chunk.js',
31 manualChunks: undefined
32 },
33 }
34 }
35 });
36