Commit 9ec32b65bdd8f625866616dc536cf25c26c163bc
Merge pull request #115 from ssbc/fix-font-paths
fix font paths using resolved absolute pathsmix irving authored on 5/30/2017, 1:06:31 PM
GitHub committed on 5/30/2017, 1:06:31 PM
Parent: 83daafefa24d872648e249940f470bafcfaab662
Parent: 53d03c145268665aa93e60777b4153a8a0c4dca5
Files changed
app/styles/css/font-awesome.js | changed |
package.json | changed |
app/styles/css/font-awesome.js | ||
---|---|---|
@@ -1,12 +1,13 @@ | ||
1 | 1 … | const nest = require('depnest') |
2 | 2 … | const fs = require('fs') |
3 | -const { join } = require('path') | |
3 … | +const { join, dirname } = require('path') | |
4 | 4 … | const { assign } = Object |
5 … | +const styleResolve = require('style-resolve') | |
5 | 6 … | |
6 | -// const css = fs.readFileSync(join(__dirname, '../../../node_modules/font-awesome/css/font-awesome.min.css'), 'utf8') | |
7 | -const css = fs.readFileSync(join(__dirname, '../../../node_modules/font-awesome/css/font-awesome.css'), 'utf8') | |
8 | - .replace(/\.{2}/g, '../font-awesome') | |
7 … | +const fontCssPath = styleResolve.sync('font-awesome') | |
8 … | +const css = fs.readFileSync(fontCssPath, 'utf8') | |
9 … | + .replace(/\.{2}/g, (match) => join(dirname(fontCssPath), match)) | |
9 | 10 … | |
10 | 11 … | // TODO: for patchlite, may have to convert font urls into url(data:base64: ....) format |
11 | 12 … | |
12 | 13 … | exports.gives = nest('styles.css') |
Built with git-ssb-web