Skip to content

Commit 4f9a50c

Browse files
authored
perf: ⚡ properly configure minify options (#27)
* perf: ⚡ properly configure minify options * refactor: 🔥 no need to resolve * fix: 🐛
1 parent c594d29 commit 4f9a50c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.swcrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://swc.rs/schema.json",
3+
"jsc": {
4+
"minify": {
5+
"compress": true,
6+
"mangle": true
7+
},
8+
"target": "es2017"
9+
}
10+
}

rollup.config.mjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import resolve from '@rollup/plugin-node-resolve';
2-
import { resolve as pathResolve } from 'node:path';
32
import { defineConfig } from 'rollup';
43
import swc from 'unplugin-swc';
54

@@ -18,8 +17,7 @@ export default defineConfig([
1817
swc.rollup({
1918
minify: true,
2019
jsc: {
21-
target: 'esnext',
22-
baseUrl: pathResolve('./'),
20+
baseUrl: import.meta.dirname,
2321
paths: {
2422
'@/*': ['./src/*'],
2523
},

src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Anatolo } from './anatolo/anatolo';
22
import * as Utils from './utils/main';
3+
import FloatBtn from './components/float-btn';
34

45
(window as any).Anatolo = Anatolo;
56
(window as any).Utils = Utils;
67

7-
import FloatBtn from './components/float-btn';
88
new FloatBtn();

0 commit comments

Comments
 (0)