artalk 2.4.4 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/Artalk.css +1 -1
- package/dist/Artalk.es.js +4872 -4072
- package/dist/Artalk.iife.js +1 -1
- package/dist/Artalk.js +1 -1
- package/dist/ArtalkLite.css +1 -1
- package/dist/ArtalkLite.es.js +2468 -1779
- package/dist/ArtalkLite.iife.js +1 -1
- package/dist/ArtalkLite.js +1 -1
- package/dist/i18n/jp.js +1 -1
- package/dist/i18n/zh-TW.js +1 -1
- package/dist/src/api/index.d.ts +2 -2
- package/dist/src/api/system.d.ts +5 -2
- package/dist/src/artalk.d.ts +42 -34
- package/dist/src/comment/comment.d.ts +2 -2
- package/dist/src/comment/height-limit.d.ts +30 -0
- package/dist/src/comment/render-ctx.d.ts +23 -0
- package/dist/src/comment/render.d.ts +2 -50
- package/dist/src/comment/renders/actions.d.ts +5 -0
- package/dist/src/comment/renders/avatar.d.ts +5 -0
- package/dist/src/comment/renders/content.d.ts +5 -0
- package/dist/src/comment/renders/header.d.ts +5 -0
- package/dist/src/comment/renders/index.d.ts +2 -0
- package/dist/src/comment/renders/pending.d.ts +5 -0
- package/dist/src/comment/renders/reply-at.d.ts +5 -0
- package/dist/src/comment/renders/reply-to.d.ts +5 -0
- package/dist/src/components/dialog.d.ts +1 -1
- package/dist/src/config.d.ts +8 -0
- package/dist/src/context.d.ts +15 -29
- package/dist/src/editor/edit-mode.d.ts +9 -0
- package/dist/src/editor/editor-ui.d.ts +25 -0
- package/dist/src/editor/editor.d.ts +37 -45
- package/dist/src/editor/funcs.d.ts +2 -0
- package/dist/src/editor/mover.d.ts +8 -0
- package/dist/src/editor/plug-manager.d.ts +17 -0
- package/dist/src/editor/plugs/editor-plug.d.ts +13 -1
- package/dist/src/editor/reply.d.ts +9 -0
- package/dist/src/editor/submit.d.ts +16 -0
- package/dist/src/editor/ui.d.ts +25 -0
- package/dist/src/i18n/index.d.ts +11 -7
- package/dist/src/layer/index.d.ts +2 -2
- package/dist/src/layer/layer.d.ts +1 -1
- package/dist/src/lib/checker/captcha-renders.d.ts +5 -0
- package/dist/src/lib/checker/index.d.ts +18 -10
- package/dist/src/lib/dark-mode.d.ts +4 -0
- package/dist/src/lib/marked.d.ts +9 -0
- package/dist/src/lib/utils.d.ts +1 -5
- package/dist/src/list/list-lite.d.ts +15 -11
- package/dist/src/list/list-nest.d.ts +2 -2
- package/dist/src/list/list-ui.d.ts +7 -0
- package/dist/src/list/paginator/adaptors/index.d.ts +12 -0
- package/dist/src/list/paginator/adaptors/pagination.d.ts +9 -0
- package/dist/src/list/paginator/adaptors/read-more.d.ts +10 -0
- package/dist/src/list/paginator/holder.d.ts +16 -0
- package/dist/src/list/paginator/index.d.ts +10 -0
- package/dist/src/service.d.ts +40 -0
- package/dist/types/artalk-config.d.ts +5 -2
- package/dist/types/artalk-data.d.ts +3 -3
- package/dist/types/context.d.ts +11 -17
- package/dist/types/global.d.ts +1 -0
- package/package.json +6 -7
- package/src/api/system.ts +3 -12
- package/src/artalk.ts +101 -158
- package/src/comment/comment.ts +7 -6
- package/src/comment/height-limit.ts +100 -0
- package/src/comment/render-ctx.ts +30 -0
- package/src/comment/render.ts +31 -375
- package/src/comment/renders/actions.ts +114 -0
- package/src/comment/renders/avatar.ts +22 -0
- package/src/comment/renders/content.ts +39 -0
- package/src/comment/renders/header.ts +84 -0
- package/src/comment/renders/index.ts +19 -0
- package/src/comment/renders/pending.ts +12 -0
- package/src/comment/renders/reply-at.ts +16 -0
- package/src/comment/renders/reply-to.ts +24 -0
- package/src/config.ts +65 -0
- package/src/context.ts +31 -86
- package/src/defaults.ts +1 -0
- package/src/editor/edit-mode.ts +102 -0
- package/src/editor/editor.ts +100 -395
- package/src/editor/funcs.ts +96 -0
- package/src/editor/mover.ts +43 -0
- package/src/editor/plug-manager.ts +172 -0
- package/src/editor/plugs/editor-plug.ts +20 -2
- package/src/editor/plugs/{emoticons-plug.less → emoticons-plug.scss} +5 -4
- package/src/editor/plugs/emoticons-plug.ts +2 -1
- package/src/editor/plugs/header-input-plug.ts +5 -5
- package/src/editor/plugs/{preview-plug.less → preview-plug.scss} +1 -1
- package/src/editor/plugs/preview-plug.ts +8 -4
- package/src/editor/plugs/upload-plug.ts +10 -13
- package/src/editor/reply.ts +62 -0
- package/src/editor/submit.ts +98 -0
- package/src/editor/ui.ts +36 -0
- package/src/i18n/index.ts +21 -10
- package/src/layer/index.ts +2 -2
- package/src/layer/layer.ts +4 -4
- package/src/layer/sidebar-layer.ts +2 -1
- package/src/lib/checker/admin.ts +36 -0
- package/src/lib/checker/captcha-renders.ts +68 -0
- package/src/lib/checker/captcha.ts +26 -0
- package/src/lib/checker/index.ts +38 -20
- package/src/lib/dark-mode.ts +48 -0
- package/src/lib/marked.ts +133 -0
- package/src/lib/utils.ts +1 -123
- package/src/list/list-lite.ts +59 -162
- package/src/list/list-ui.ts +80 -0
- package/src/list/list.ts +16 -8
- package/src/list/paginator/adaptors/index.ts +21 -0
- package/src/list/paginator/adaptors/pagination.ts +42 -0
- package/src/list/paginator/adaptors/read-more.ts +56 -0
- package/src/list/paginator/holder.ts +55 -0
- package/src/list/paginator/index.ts +13 -0
- package/src/service.ts +118 -0
- package/src/style/{_color.less → _color.scss} +3 -3
- package/src/style/{_extend.less → _extend.scss} +1 -1
- package/src/style/_variables.scss +3 -0
- package/src/style/{comment.less → comment.scss} +36 -12
- package/src/style/{editor.less → editor.scss} +11 -11
- package/src/style/{list.less → list.scss} +8 -6
- package/src/style/{main.less → main.scss} +24 -23
- package/src/style/{sidebar-layer.less → sidebar-layer.scss} +8 -8
- package/types/artalk-config.d.ts +5 -2
- package/types/artalk-data.d.ts +3 -3
- package/types/context.d.ts +11 -17
- package/types/global.d.ts +1 -0
- package/CNAME +0 -1
- package/LICENSE +0 -165
- package/index.html +0 -157
- package/postcss.config.js +0 -5
- package/scripts/build-i18n.mjs +0 -46
- package/src/lib/checker/admin-checker.ts +0 -36
- package/src/lib/checker/captcha-checker.ts +0 -84
- package/src/style/_variables.less +0 -3
- package/test/ArtalkCount.html +0 -16
- package/test/ArtalkI18n.html +0 -16
- package/test/ArtalkLite.html +0 -15
- package/test/CSRF.html +0 -26
- package/tsconfig.json +0 -12
- package/vite-base.config.ts +0 -21
- package/vite-demo.config.ts +0 -12
- package/vite-lite.config.ts +0 -22
- package/vite.config.ts +0 -27
- /package/dist/src/lib/checker/{admin-checker.d.ts → admin.d.ts} +0 -0
- /package/dist/src/lib/checker/{captcha-checker.d.ts → captcha.d.ts} +0 -0
- /package/src/style/{pagination.less → pagination.scss} +0 -0
package/scripts/build-i18n.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import fs from 'fs'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import { build } from 'vite'
|
|
4
|
-
import { fileURLToPath } from 'url'
|
|
5
|
-
|
|
6
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
7
|
-
const i18nPath = path.join(__dirname, '../src/i18n/')
|
|
8
|
-
const outDir = path.resolve(__dirname, '../dist/i18n')
|
|
9
|
-
|
|
10
|
-
// empty outDir before build
|
|
11
|
-
fs.rmSync(outDir, { recursive: true, force: true })
|
|
12
|
-
|
|
13
|
-
const libraries = []
|
|
14
|
-
|
|
15
|
-
fs.readdirSync(i18nPath).forEach(f => {
|
|
16
|
-
if (['index.ts'].includes(f)) return
|
|
17
|
-
|
|
18
|
-
const filename = path.join(i18nPath, f)
|
|
19
|
-
const lang = path.parse(filename).name
|
|
20
|
-
const content = fs.readFileSync(filename);
|
|
21
|
-
|
|
22
|
-
// only compile the external locale
|
|
23
|
-
if (!content.toString().includes('defineLocaleExternal')) return
|
|
24
|
-
|
|
25
|
-
libraries.push({
|
|
26
|
-
entry: filename,
|
|
27
|
-
name: lang,
|
|
28
|
-
fileName: (format) => ((format == "umd") ? `${lang}.js` : `${lang}.${format}.js`),
|
|
29
|
-
})
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
libraries.forEach(async (lib) => {
|
|
33
|
-
await build({
|
|
34
|
-
build: {
|
|
35
|
-
target: 'es2015',
|
|
36
|
-
outDir: outDir,
|
|
37
|
-
minify: 'terser',
|
|
38
|
-
emptyOutDir: false,
|
|
39
|
-
lib: {
|
|
40
|
-
...lib,
|
|
41
|
-
formats: ['umd'],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
configFile: false, // prevent load any vite config file
|
|
45
|
-
})
|
|
46
|
-
})
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as Utils from '../utils'
|
|
2
|
-
import { Checker } from '.'
|
|
3
|
-
|
|
4
|
-
const AdminChecker: Checker = {
|
|
5
|
-
inputType: 'password',
|
|
6
|
-
|
|
7
|
-
request(that, ctx, inputVal) {
|
|
8
|
-
const data = {
|
|
9
|
-
name: that.ctx.user.data.nick,
|
|
10
|
-
email: that.ctx.user.data.email,
|
|
11
|
-
password: inputVal
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (async () => {
|
|
15
|
-
const resp = await that.ctx.getApi().user.login(data.name, data.email, data.password)
|
|
16
|
-
return resp.token
|
|
17
|
-
})()
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
body(that, ctx) {
|
|
21
|
-
return Utils.createElement(`<span>${that.ctx.$t('adminCheck')}</span>`)
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
onSuccess(that, ctx, userToken, inputVal, formEl) {
|
|
25
|
-
that.ctx.user.update({
|
|
26
|
-
isAdmin: true,
|
|
27
|
-
token: userToken
|
|
28
|
-
})
|
|
29
|
-
that.ctx.trigger('user-changed', that.ctx.user.data)
|
|
30
|
-
that.ctx.listReload()
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
onError(that, ctx, err, inputVal, formEl) {}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default AdminChecker
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import * as Utils from '../utils'
|
|
2
|
-
import * as Ui from '../ui'
|
|
3
|
-
import { Checker } from '.'
|
|
4
|
-
|
|
5
|
-
const CaptchaChecker: Checker = {
|
|
6
|
-
request(that, ctx, inputVal) {
|
|
7
|
-
return that.ctx.getApi().captcha.captchaCheck(inputVal)
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
body(that, ctx) {
|
|
11
|
-
// Iframe 验证方式
|
|
12
|
-
if (that.captchaConf.iframe) {
|
|
13
|
-
const $iframeWrap = Utils.createElement(`<div class="atk-checker-iframe-wrap"></div>`)
|
|
14
|
-
const $iframe = Utils.createElement<HTMLIFrameElement>(`<iframe class="atk-fade-in"></iframe>`)
|
|
15
|
-
$iframe.style.display = 'none'
|
|
16
|
-
Ui.showLoading($iframeWrap, { transparentBg: true })
|
|
17
|
-
$iframe.src = `${that.ctx.conf.server}/api/captcha/get?t=${+new Date()}`
|
|
18
|
-
$iframe.onload = () => {
|
|
19
|
-
$iframe.style.display = ''
|
|
20
|
-
Ui.hideLoading($iframeWrap)
|
|
21
|
-
}
|
|
22
|
-
$iframeWrap.append($iframe)
|
|
23
|
-
|
|
24
|
-
const $closeBtn = Utils.createElement(`<div class="atk-close-btn"><i class="atk-icon atk-icon-close"></i></div>`)
|
|
25
|
-
$iframeWrap.append($closeBtn)
|
|
26
|
-
|
|
27
|
-
ctx.hideInteractInput()
|
|
28
|
-
|
|
29
|
-
// 轮询状态
|
|
30
|
-
let stop = false // 打断
|
|
31
|
-
const sleep = (ms: number) => new Promise((resolve) => { window.setTimeout(() => { resolve(null) }, ms) })
|
|
32
|
-
;(async function queryStatus() {
|
|
33
|
-
await sleep(1000)
|
|
34
|
-
if (stop) return
|
|
35
|
-
let isPass = false
|
|
36
|
-
try {
|
|
37
|
-
const resp = await that.ctx.getApi().captcha.captchaStatus()
|
|
38
|
-
isPass = resp.is_pass
|
|
39
|
-
} catch { isPass = false }
|
|
40
|
-
if (isPass) {
|
|
41
|
-
ctx.triggerSuccess()
|
|
42
|
-
} else {
|
|
43
|
-
queryStatus()
|
|
44
|
-
}
|
|
45
|
-
})()
|
|
46
|
-
|
|
47
|
-
$closeBtn.onclick = () => {
|
|
48
|
-
stop = true
|
|
49
|
-
ctx.cancel()
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return $iframeWrap
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 图片验证方式
|
|
56
|
-
const elem = Utils.createElement(
|
|
57
|
-
`<span><img class="atk-captcha-img" src="${that.captchaConf.imgData || ''}">${that.ctx.$t('captchaCheck')}</span>`
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
// 刷新验证码
|
|
61
|
-
elem.querySelector<HTMLElement>('.atk-captcha-img')!.onclick = () => {
|
|
62
|
-
const imgEl = elem.querySelector('.atk-captcha-img')
|
|
63
|
-
that.ctx.getApi().captcha.captchaGet()
|
|
64
|
-
.then((imgData) => {
|
|
65
|
-
imgEl!.setAttribute('src', imgData)
|
|
66
|
-
})
|
|
67
|
-
.catch((err) => {
|
|
68
|
-
console.error('Failed to get captcha image ', err)
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
return elem
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
onSuccess(that, ctx, data, inputVal, formEl) {
|
|
75
|
-
that.captchaConf.val = inputVal
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
onError(that, ctx, err, inputVal, formEl) {
|
|
79
|
-
formEl.querySelector<HTMLElement>('.atk-captcha-img')!.click() // 刷新验证码
|
|
80
|
-
formEl.querySelector<HTMLInputElement>('input[type="text"]')!.value = '' // 清空输入框输入
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export default CaptchaChecker
|
package/test/ArtalkCount.html
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script src="../dist/Artalk.js"></script>
|
|
2
|
-
|
|
3
|
-
<div class="pv" data-page-key="https://artalk.js.org/">0</div>
|
|
4
|
-
<div class="pv" data-page-key="https://artalk.js.org/guide/intro.html">0</div>
|
|
5
|
-
|
|
6
|
-
<div class="count" data-page-key="https://artalk.js.org/">0</div>
|
|
7
|
-
<div class="count" data-page-key="https://artalk.js.org/guide/intro.html">0</div>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
var artalk = Artalk.LoadCountWidget({
|
|
11
|
-
server: 'http://localhost:23366',
|
|
12
|
-
site: 'ArtalkDocs',
|
|
13
|
-
pvEl: '.pv',
|
|
14
|
-
countEl: ".count",
|
|
15
|
-
});
|
|
16
|
-
</script>
|
package/test/ArtalkI18n.html
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<link rel="stylesheet" href="../dist/Artalk.css">
|
|
2
|
-
<script src="../dist/Artalk.js"></script>
|
|
3
|
-
<script src="../dist/i18n/zh-TW.js"></script>
|
|
4
|
-
|
|
5
|
-
<div id="comments"></div>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
var artalk = new Artalk({
|
|
9
|
-
el: '#comments',
|
|
10
|
-
pageKey: 'https://artalk.js.org/',
|
|
11
|
-
pageTitle: 'Artalk Home',
|
|
12
|
-
server: 'http://localhost:23366',
|
|
13
|
-
site: 'ArtalkDocs',
|
|
14
|
-
locale: 'auto',
|
|
15
|
-
});
|
|
16
|
-
</script>
|
package/test/ArtalkLite.html
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!-- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> -->
|
|
2
|
-
<link rel="stylesheet" href="../dist/ArtalkLite.css">
|
|
3
|
-
<script src="../dist/ArtalkLite.js"></script>
|
|
4
|
-
|
|
5
|
-
<div id="comments"></div>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
var artalk = new Artalk({
|
|
9
|
-
el: '#comments',
|
|
10
|
-
pageKey: 'https://artalk.js.org/',
|
|
11
|
-
pageTitle: 'Artalk Home',
|
|
12
|
-
server: 'http://localhost:23366',
|
|
13
|
-
site: 'ArtalkDocs',
|
|
14
|
-
});
|
|
15
|
-
</script>
|
package/test/CSRF.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>CSRF Test</title>
|
|
8
|
-
|
|
9
|
-
<!-- 解除注释来测试当 referer 为空时的行为 -->
|
|
10
|
-
<!-- <meta name="referrer" content="never"> -->
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
|
|
14
|
-
<form action="http://localhost:23366/api/add" method="post">
|
|
15
|
-
<input type="text" name="name" value="admin">
|
|
16
|
-
<input type="text" name="email" value="test@example.com">
|
|
17
|
-
<input type="text" name="link" value="">
|
|
18
|
-
<input type="text" name="content" value="CSRF Success">
|
|
19
|
-
<input type="text" name="rid" value="0">
|
|
20
|
-
<input type="text" name="page_key" value="https://artalk.js.org/">
|
|
21
|
-
<input type="text" name="site_name" value="ArtalkDocs">
|
|
22
|
-
<button type="submit">Fire!</button>
|
|
23
|
-
</form>
|
|
24
|
-
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|
package/tsconfig.json
DELETED
package/vite-base.config.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
3
|
-
import { resolve } from 'path'
|
|
4
|
-
import dts from 'vite-plugin-dts'
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
css: {
|
|
8
|
-
preprocessorOptions: {
|
|
9
|
-
less: {
|
|
10
|
-
additionalData: `@import "./src/style/_variables.less";@import "./src/style/_extend.less";`
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
resolve: {
|
|
15
|
-
alias: {
|
|
16
|
-
'@': resolve(__dirname, 'src'),
|
|
17
|
-
'~': resolve(__dirname),
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
plugins: [tsconfigPaths(), dts()],
|
|
21
|
-
})
|
package/vite-demo.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import { resolve } from 'path'
|
|
3
|
-
import baseConf from './vite-base.config'
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
build: {
|
|
7
|
-
target: 'esnext',
|
|
8
|
-
outDir: resolve(__dirname, "deploy"),
|
|
9
|
-
rollupOptions: {}
|
|
10
|
-
},
|
|
11
|
-
...baseConf
|
|
12
|
-
})
|
package/vite-lite.config.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import fullVersionConf from './vite.config'
|
|
2
|
-
import * as Utils from './src/lib/utils'
|
|
3
|
-
|
|
4
|
-
export default Utils.mergeDeep(fullVersionConf, {
|
|
5
|
-
build: {
|
|
6
|
-
lib: {
|
|
7
|
-
fileName: (format) => ((format == "umd") ? 'ArtalkLite.js' : `ArtalkLite.${format}.js`),
|
|
8
|
-
},
|
|
9
|
-
rollupOptions: {
|
|
10
|
-
external: ['marked'],
|
|
11
|
-
output: {
|
|
12
|
-
globals: {
|
|
13
|
-
marked: 'marked',
|
|
14
|
-
},
|
|
15
|
-
assetFileNames: (assetInfo) => (/\.css$/.test(assetInfo.name) ? "ArtalkLite.css" : "[name].[ext]")
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
define: {
|
|
20
|
-
ARTALK_LITE: true,
|
|
21
|
-
},
|
|
22
|
-
})
|
package/vite.config.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import { resolve } from 'path'
|
|
3
|
-
import baseConf from './vite-base.config'
|
|
4
|
-
import * as Utils from './src/lib/utils'
|
|
5
|
-
|
|
6
|
-
export default Utils.mergeDeep(baseConf, defineConfig({
|
|
7
|
-
build: {
|
|
8
|
-
target: 'es2015',
|
|
9
|
-
outDir: resolve(__dirname, "dist"),
|
|
10
|
-
minify: 'terser',
|
|
11
|
-
emptyOutDir: false,
|
|
12
|
-
lib: {
|
|
13
|
-
entry: resolve(__dirname, 'src/main.ts'),
|
|
14
|
-
name: 'Artalk',
|
|
15
|
-
fileName: (format) => ((format == "umd") ? 'Artalk.js' : `Artalk.${format}.js`),
|
|
16
|
-
formats: ["es", "umd", "iife"]
|
|
17
|
-
},
|
|
18
|
-
rollupOptions: {
|
|
19
|
-
output: {
|
|
20
|
-
assetFileNames: (assetInfo) => (/\.css$/.test(assetInfo.name || '') ? "Artalk.css" : "[name].[ext]"),
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
define: {
|
|
25
|
-
ARTALK_LITE: false,
|
|
26
|
-
},
|
|
27
|
-
}))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|