Closed yunisdev closed 2 years ago
@yunisdev have you managed to make it work?
I too struggled. I tried to follow the docs for customizing with this config:
tsdx.config.js
const url = require("rollup-plugin-url");
module.exports = {
rollup(config, options) {
config.plugins.push(
url({
include: ["**/*.otf"],
limit: Infinity,
})
);
return config;
},
};
It doesn't seem to work.
This did the trick: https://github.com/jaredpalmer/tsdx/issues/379#issuecomment-569011510
Not sure why config.plugins.push
doesn't work but spread operator does. Maybe, the plugin-url
must be the first plugin over the existing ones.
Thanks for providing a link to the answer in the HOWTOs @iceniveth .
Not sure why
config.plugins.push
doesn't work but spread operator does. Maybe, theplugin-url
must be the first plugin over the existing ones.
Yes, that would be why. Usually if a plugin introduces a new syntax (or entire file encoding in this case), it has to go early on in the plugin chain as it must parse that syntax before others try to (and error out trying to). This principle applies to Babel plugins and custom parsers too, as well as other similar tools.
Current Behavior
I want to use otf fonts in my project. But when I import them, I get this error below:
Expected behavior
How can I fix this problem? This is link to my repo
My environment