vite-plugin-externals icon indicating copy to clipboard operation
vite-plugin-externals copied to clipboard

请问vite自带的rollup配置rollupOptions和这个插件有什么区别

Open ghost opened this issue 1 year ago • 1 comments

build: {
    rollupOptions: {
      external: ['react', 'react-dom', 'dayjs', 'antd'],
      output: {
        globals: {
          react: 'React',
          'react-dom': 'ReactDOM',
          dayjs: 'dayjs',
          antd: 'antd',
        },
        paths: {
          react:
            'https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js',
          'react-dom':
            'https://unpkg.com/[email protected]/umd/react-dom.production.min.js',
          dayjs:
            'https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.11.10/dayjs.min.js',
          antd: 'https://cdnjs.cloudflare.com/ajax/libs/antd/5.9.4/antd.min.js',
        },
      },
}
    },

vite可以配置external相关,为啥还要出个插件呢?

ghost avatar Oct 02 '23 07:10 ghost