forked from almes10/ssr_subscrible_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (22 loc) · 650 Bytes
/
app.js
File metadata and controls
27 lines (22 loc) · 650 Bytes
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
/**
* 入口文件
*/
/**
* 开发依赖
*/
let path = require('path')
let util = require('./util')
let base64 = util.base64
let readSync = util.readSync
let writeSync = util.writeSync
let BUILD_DIR = 'dist' // 构建目录
let ENTRY_FILE = './node.txt' // SS(R)入口
let str = readSync(ENTRY_FILE)
let checker = item => {
return item => item.includes('ssr://') || item.includes('ss"//')
}
// Map all the item include `ssr://` and serialize those items
let result = str.split('\n\n')
.filter(item => checker(item))
.join('\r\n')
writeSync(path.resolve(__dirname, BUILD_DIR, 'index.html'), base64(result))