Closed lrembacz closed 10 months ago
Hi @lrembacz , the missing js files are for environments that you are not using, so it is safe to ignore them. You can create a build plugin for Astro to exclude those files from the build. Something like this:
// exclude-module-plugin.js
export default function excludeModulePlugin() {
return {
name: 'exclude-module-plugin',
resolveId(id) {
// Exclude the specific module you want to ignore
if (id === './lib/ilib-qt.js' || id === './ilib/ilib-rhino.js' || [etc] ) {
return false;
}
}
};
}
Then update your astro.config.js to add this plugin to the "build.plugins" array.
Unluckly it is not working. Those files are not even processed by this plugin, so it should be something different i guess.
I've pushed repository to github, so you can check yourself https://github.com/lrembacz/astro-ilib-error.
I have tried to use externals
as well, but it doesn't seem to work either.
I'm not really too sure how Astro works, as I have never used it before. (ChatGPT helped me make the suggestion for the excludeModulePlugin!) You can find the missing ilib files in the ilib sources.
I am thinking that we can ship those extra ilib-
For now, you can create some empty files node_modules/ilib/lib/ilib-qt.js, node_modules/ilib/lib/ilib-rhino.js, etc. See if it works with those..
Okey. I have tried to make it work, but there are more issues with that. Thanks for help!
When building AstroJS app with
@enact/sandstone
I'm getting errors like:`X [ERROR] Could not resolve "./lib/ilib-qt.js"
X [ERROR] Could not resolve "./lib/ilib-rhino.js"
X [ERROR] Could not resolve "./lib/ilib-ringo.js"
dependencies looks like this:
In
node_modules/ilib
there is no such files, so they can't be resolved. Can you help with it somehow?