-
Notifications
You must be signed in to change notification settings - Fork 192
/
script.js
56 lines (52 loc) · 1.36 KB
/
script.js
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
const jsContent = `import './api.js'
import './colorize.js'
import './form.js'
import './state.js'
import './visibility.js'
import './visit.js'
import './site.js'
import './accordion.js'
import './checkbox.js'
import './dimmer.js'
import './dropdown.js'
import './embed.js'
import './modal.js'
import './nag.js'
import './popup.js'
import './progress.js'
import './rating.js'
import './search.js'
import './shape.js'
import './sidebar.js'
import './sticky.js'
import './tab.js'
import './transition.js'
`
// create semantic-ui.js
const fs = require('fs')
fs.writeFile('./src/semantic-ui.js', jsContent, err => {
if (err) console.log('create semantic-ui.js fail', err)
})
// create semantic-ui.scss
const cssContent = `@import './globals/all';
@import './elements/all';
@import './collections/all';
@import './views/all';
@import './modules/all';
`
fs.writeFile('./src/scss/semantic-ui.scss', cssContent, err => {
if (err) console.log('create semantic-ui.scss fail', err)
})
// replace image-url and font-url
fs.writeFileSync(
'./src/scss/elements/_icon.scss',
fs
.readFileSync('./src/scss/elements/_icon.scss', 'utf8')
.replace(/font-url\(\"semantic-ui/g, `url("../../assets/fonts`)
)
fs.writeFileSync(
'./src/scss/elements/_flag.scss',
fs
.readFileSync('./src/scss/elements/_flag.scss', 'utf8')
.replace(/image-url\(\"semantic-ui/g, `url("../../assets/images`)
)