mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-11 14:22:51 +00:00
more working
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import fs from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig } from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
|
||||
const logExternal: boolean = false;
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
@@ -22,11 +25,14 @@ export default defineConfig({
|
||||
build: {
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
external: ['react', 'react/jsx-runtime', 'react-native-webview'],
|
||||
// external: () => {
|
||||
// fs.writeFileSync('dep.log', `${dep}\n`, { flag: 'a' });
|
||||
// return false;
|
||||
// }
|
||||
// Externalize all non-relative, non-absolute imports (i.e. dependencies)
|
||||
// Keep only our own sources and the raw internal HTML in the bundle.
|
||||
external: (id) => {
|
||||
if (logExternal) fs.writeFileSync('dep.log', `${id}\n`, { flag: 'a' });
|
||||
const isRelative = id.startsWith('.') || id.startsWith('/');
|
||||
const isInternalHtml = id.includes('dist-internal/index.html?raw');
|
||||
return !isRelative && !isInternalHtml;
|
||||
},
|
||||
},
|
||||
lib: {
|
||||
entry: resolve(__dirname, 'src/index.tsx'),
|
||||
|
||||
Reference in New Issue
Block a user