Jesse Feng
Jesse Feng
@huangjihua 可以具体描述一下怎么使用的吗? 是否类似以下配置 ```js export default defineConfig({ plugins: [ createExternals({ externals: { react: 'React', 'react-dom': 'ReactDOM', 'react-router': 'ReactRouter', 'react-router-dom': 'ReactRouterDOM' } }) ] }); ``` 确认一下`react-router`有没有排出,最好贴一下你的配置
@IanVS `vite-plugin-external` or `vite-plugin-externals`? Would you mind if I got an example from you about this issue, actually I do not know this issue https://github.com/rollup/rollup/issues/2374 because I never do `output.globals`...
@cixing 你有没有比较简单的demo我试一下
我也发现有这个问题,用livego模拟推流
@irshadahmad21 Can you provide a simple demo? I will use this demo to confirm after optimization
@irshadahmad21 Look at that https://github.com/fengxinming/vite-plugins/tree/dev/packages/vite-plugin-external#fix-rollup3188, you can use the new option `externalGlobals`. Sorry for the late reply
@irshadahmad21 Upgrade `[email protected]` and `[email protected]` to fix this issue. See https://stackblitz.com/edit/vite-external-demo-wuflfzcl?file=index.html
@irshadahmad21 Usually we build bundles with `iife` format, like this ```js build: { rollupOptions: { output: { format: 'iife', }, }, }, ``` Because the default format is `es`, if...
@irshadahmad21 Just found a new way to solve this problem, see this demo https://stackblitz.com/edit/vite-external-demo-wuflfzcl?file=vite.config.ts . Notice: 1、Define `React` variable like this `import React, { useState } from 'react';` 2、Modify `tsconfig.json`...
@irshadahmad21 Because 'rollup-plugin-external-globals' parses JS code again, I think it would be more slowly to build bundles. review that output bundle, you can see ```js (function polyfill() { const relList...