-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support async rollup plugins / objectHashIgnoreUnknownHack flag from rpt2 #294
Comments
i dont 100% understand. what is rpt2? why are we adding a flag just to pass a flag to a specific dependency others may not have? i definitely dont like the suggested solution but think there is a bigger solve here. please explain your rpt2 usage. |
Hi @sw-yx! Sorry for not being so clear at first. So, The plugin has a property called I'm extending I'm suggesting adding a flag to Does this clarify the problem? |
ah i see. thanks for explaining! i guess i dont know enough to be helpful. will leave to @medelman17 or @jaredpalmer |
I've ran into this issue today too: vladshcherbin/rollup-plugin-copy#16 (comment) While using Here is some history on the |
Another thing to notice is that the |
While I was searching for ways to import assets by using plugins like rollup-plugin-url and rollup-plugin-smart-asset, I get this error too. |
@sw-yx, seems like there are more use cases and more plugins a solution regarding the flag. Can I open a PR and we continue the discussion there since we didn't get any inputs from other maintainers? |
For those who need to bypass this restriction, a workaround for now is to override the plugin on your custom config, like this: config.plugins = config.plugins.map(plugin => {
if (plugin && plugin.name === 'rpt2') {
return rpts2({
// properties that I added for demonstration purposes
clean: true,
objectHashIgnoreUnknownHack: true,
// properties in the current internal implementation of tsdx
typescript: require('typescript'),
cacheRoot: `./.rts2_cache_${options.format}`,
tsconfig: options.tsconfig,
tsconfigDefaults: {
compilerOptions: {
sourceMap: true,
declaration: true,
jsx: 'react',
},
},
tsconfigOverride: {
compilerOptions: {
target: 'esnext',
},
},
});
}
return plugin;
}); And you can even remove what's unnecessary for you, of course. |
yeah this is above my paygrade. thanks @arthurdenner for providing the fix. will leave to jared n co |
@arthurdenner @sw-yx |
Let's make PR's and add docs for each. |
For those who haven't seen the references above, wanted to note here that I've created ezolenko/rollup-plugin-typescript2#203 (after pushing for puleos/object-hash#90 to be merged). As is mentioned here and elsewhere, |
I've been following your effort to get this done and thank you, @agilgur5! Really appreciate it! |
Out-of-the-box support for async rollup plugins was just released in v0.13.0! |
Current Behavior
I'm using tsdx to bundle react-semantic-ui-datepickers and I can't upgrade
rollup-plugin-copy
to v3 because the build fails with the errorUnknown object type "asyncfunction"
. This is because we are not passing the flagobjectHashIgnoreUnknownHack
torpt2
which would solve the issue.Can we add support for this flag on the
build
command or is that kind of risky? Therpt2
documentation states:Setting this option to true will make object-hash ignore unknowns, at the cost of not invalidating the cache if ignored elements are changed.
Desired Behavior
Build can be successful if the plugin gets the flag as
true
.Suggested Solution
Add an option to the
build
command ---ignore-unknown-hack
? - that results in theobjectHashIgnoreUnknownHack
being true while creating therollup
config.Who does this impact? Who is this for?
tsdx
users with customrollup
configs using plugins that use async/await, for example.Describe alternatives you've considered
N/A.
Additional context
N/A.
The text was updated successfully, but these errors were encountered: