G icon indicating copy to clipboard operation
G copied to clipboard

chore: optimizing the build toolchain

Open wang1212 opened this issue 1 year ago • 1 comments

🤔 This is a ...

  • [ ] New feature
  • [ ] Bug fix
  • [ ] Site / Document optimization
  • [ ] TypeScript definition update
  • [ ] Refactoring
  • [ ] Performance improvement
  • [ ] Code style optimization
  • [ ] Test Case
  • [ ] Branch merge
  • [x] Other (about what?)

🔗 Related issue link

see #1781 , etc.

💡 Background and solution

Adjust the rollup code compilation tool chain to babel, because babel has more refined control over the code than typescript and can correctly handle dependent sourcemaps.

Fix the code formatting conflict between eslint and prettier, and also solve the problem that all configuration rules of eslint are not really effective.

In summary, the above measures fix the following issues:

  • Sourcemap can now be processed and generated correctly, and projects such as vite can parse correctly.
  • ESLint and prettier can now work together normally to uniformly format the code.

In addition, by introducing some rollup plug-ins, we prepare for subsequent engineering optimization.

wang1212 avatar Oct 10 '24 04:10 wang1212

lock 文件要不从仓库去掉?

Aarebecca avatar Oct 10 '24 09:10 Aarebecca

lock 文件要不从仓库去掉?

是遇到什么问题了么?

wang1212 avatar Oct 22 '24 02:10 wang1212

vite 的 sourcemap 没有生效是什么原因

lvisei avatar Oct 22 '24 06:10 lvisei

vite 的 sourcemap 没有生效是什么原因

tsconfig 的配置不太对,以及 tsc 只支持处理包源码的 sourcemap,会直接忽略包依赖的 sourcemap,导致生成的 sourcemap 异常,除非将 src(或编译后的产物)也发布到 npm 才可以

wang1212 avatar Oct 22 '24 07:10 wang1212

tsconfig 的配置不太对,以及 tsc 只支持处理包源码的 sourcemap,会直接忽略包依赖的 sourcemap,导致生成的 sourcemap 异常,除非将 src(或编译后的产物)也发布到 npm 才可以

现在是把 src 发布到 npm 吗

lvisei avatar Oct 22 '24 07:10 lvisei

tsconfig 的配置不太对,以及 tsc 只支持处理包源码的 sourcemap,会直接忽略包依赖的 sourcemap,导致生成的 sourcemap 异常,除非将 src(或编译后的产物)也发布到 npm 才可以

现在是把 src 发布到 npm 吗

没有,只会发布 dist 目录,即打包后的单文件,不发布编译 src(或编译后产生的 js 源代码)的目录

wang1212 avatar Oct 22 '24 09:10 wang1212