V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Leviathann
V2EX  ›  Vite

vite 应该怎么学?

  •  
  •   Leviathann · Jan 9, 2022 · 4406 views
    This topic created in 1581 days ago, the information mentioned may be changed or developed.
    尝试配了一下,发现很多东西官网都没讲
    有的配置还和 rollup 有重叠

    比如我想把打包的东西都输出到一个文件夹(而不是默认的 dist + dist/asset )并且自定义一个打包目标文件名,在官网搜了半天没搜到怎么配,尝试配 buildRollupOptions ,改了 file 又报错,又根据报错改了几个配置项才发现原来需要把 dir 和 manualChunks 设为 undefined 来把 vite 默认的配置覆盖掉才行

    怎么才能知道 vite 默认的 rollup 配置是啥?必须看源码吗?

    而且感觉前端的工具链有很多重叠的功能,esbuild 可以设置编译目标,tsc 也可以,rollup 也可以用 babel 插件做

    tsc 直接指定版本就行( es5 )而 esbuild 和 babel 要用个奇怪的 query 字符串,指定浏览器版本或者占有率啥的?

    另外如果想指定输入和输出的 html 文件名又该怎么做?

    官网没提,翻 rollup 的文档发现官方的实例的 entry 都是 js 文件,试了一下手动在 rollupOptions 指定 input ,但是又和 output 的 file 冲突?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3067 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 12:58 · PVG 20:58 · LAX 05:58 · JFK 08:58
    ♥ Do have faith in what you're doing.