-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsemantic-fix.js
27 lines (23 loc) · 946 Bytes
/
semantic-fix.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
// Since 04/18/2018 - This file is for reference only.
// No need to run it, but use "resolve/alias" in webpack config files both dev/prod.config.js
//
// Reference: https://www.artembutusov.com/webpack-semantic-ui/
var fs = require('fs');
// relocate default config
fs.writeFileSync(
'node_modules/semantic-ui-less/theme.config',
"@import '../../src/semantic/theme.config';\n",
'utf8'
);
// fix well known bug with default distribution
fixFontPath('node_modules/semantic-ui-less/themes/default/globals/site.variables');
fixFontPath('node_modules/semantic-ui-less/themes/flat/globals/site.variables');
fixFontPath('node_modules/semantic-ui-less/themes/material/globals/site.variables');
function fixFontPath(filename) {
var content = fs.readFileSync(filename, 'utf8');
var newContent = content.replace(
"@fontPath : '../../themes/",
"@fontPath : '../../../themes/"
);
fs.writeFileSync(filename, newContent, 'utf8');
}