Commit 53d03c145268665aa93e60777b4153a8a0c4dca5
fix font paths using resolved absolute paths
Michael Williams committed on 5/30/2017, 6:44:19 AMParent: 3d780c579e0f06cbd0b73c7b9a4ade8222b7f8fd
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