Closed nmassi closed 4 years ago
push../node_modules/fontkit/base.js.fontkit.create
You should not import base.js but index.js
push../node_modules/fontkit/base.js.fontkit.create
You should not import base.js but index.js
I got a webpack error when using 'fontkit'
.
TypeError: __webpack_require__(...).readFileSync is not a function
(anonymous function)
src/opentype/shapers/ArabicShaper.js:5
2 | import unicode from 'unicode-properties';
3 | import UnicodeTrie from 'unicode-trie';
4 |
> 5 | const trie = new UnicodeTrie(require('fs').readFileSync(__dirname + '/data.trie'));
6 | const FEATURES = ['isol', 'fina', 'fin2', 'fin3', 'medi', 'med2', 'init'];
7 |
8 | const ShapingClasses = {
Add this line to webpack config: https://github.com/blikblum/pdfkit-webpack-example/blob/master/webpack.config.js#L13 (together withtransform-loader and brfs as dev dependencies)
Or use fontkit-next https://www.npmjs.com/package/fontkit-next
Add this line to webpack config: https://github.com/blikblum/pdfkit-webpack-example/blob/master/webpack.config.js#L13 (together withtransform-loader and brfs as dev dependencies)
Or use fontkit-next https://www.npmjs.com/package/fontkit-next
fontkit-next solved the issue. Thanks @blikblum :)
This is how I fetch and save the stream.