1 Star 0 Fork 0

Seth / logseq-plugin-charspacing

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rollup.config.mjs 957 Bytes
一键复制 编辑 原始数据 按行查看 历史
Seth 提交于 2022-05-21 10:44 . chore: use rollup and swc
import html from "@rollup/plugin-html"
import { nodeResolve } from "@rollup/plugin-node-resolve"
import { readFile } from "fs/promises"
import { defineRollupSwcOption, swc } from "rollup-plugin-swc3"
export default {
input: "src/index.js",
output: {
dir: "dist",
entryFileNames: "[name].[hash].js",
},
plugins: [
html({
fileName: "index.html",
template: async ({ files }) => {
const content = await readFile("src/index.html", { encoding: "utf8" })
const fileName = files.js.find(({ name }) => name === "index").fileName
return content
.replace(
"{preload}",
`<link rel="modulepreload" as="script" href="${fileName}" />`,
)
.replace("{js}", `<script type="module" src="${fileName}"></script>`)
},
}),
nodeResolve(),
swc(
defineRollupSwcOption({
jsc: {
target: "es2021",
},
}),
),
],
}
1
https://gitee.com/sethyuan/logseq-plugin-charspacing.git
git@gitee.com:sethyuan/logseq-plugin-charspacing.git
sethyuan
logseq-plugin-charspacing
logseq-plugin-charspacing
master

搜索帮助