Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
56 lines (51 loc) · 1.53 KB
/
Copy pathvite.config.ts
File metadata and controls
56 lines (51 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { defineConfig } from "vite-plus";
import babel from "@rolldown/plugin-babel";
import coreJSPurePackage from "core-js-pure/package.json" with { type: "json" };
const config = defineConfig({
test: { include: ["test/**/*.test.ts"] },
fmt: {
tabWidth: 4,
printWidth: 110,
ignorePatterns: ["README.md"],
},
lint: { options: { typeAware: true, typeCheck: true } },
pack: {
minify: true,
sourcemap: true,
platform: "neutral",
dts: { tsgo: true },
fixedExtension: true,
plugins: [createBabelPlugin()],
publint: true,
attw: { level: "error", profile: "esm-only" },
target: ["chrome111", "edge111", "firefox114", "safari16.4", "ios16.4", "node22"],
exports: {
customExports(exports) {
return {
...exports,
".": {
types: "./dist/index.d.mts",
import: "./dist/index.mjs",
default: "./dist/index.mjs",
},
};
},
},
},
});
function createBabelPlugin() {
return babel({
include: /src\/.*\.[jt]s$/,
presets: [["@babel/preset-env", { modules: false }]],
plugins: [
[
"babel-plugin-polyfill-corejs3",
{
method: "usage-pure",
version: coreJSPurePackage.version,
},
],
],
});
}
export default config;