plugins: [new SwupA11yPlugin()] written in example but "SwupA11YPlugin" is written in code
ckirby19 opened this issue · 5 comments
"SwupA11YPlugin" is writen with a capital Y in the code, but the example has a small y
const swup = new Swup({
plugins: [new SwupA11yPlugin()]
});
should be:
const swup = new Swup({
plugins: [new SwupA11YPlugin()]
});
or the code changed to have "SwupA11yPlugin"
Good catch, thanks for reporting.
Unfortunately, this is not a typo but a tooling issue. The correct name is SwupA11yPlugin
with a lowercase y
-- which would make the code example correct if you're using ES6 module imports. However, the plugin name seems to get mangled in minification, however, hence the incorrect spelling of the ES5 browser build export and filename. I'll need to take a look under the hood of the webpack boilerplate to see how to best solve this.
Thanks for letting me know! I was using the Plugin directly by putting it into my lists of scripts, so I just changed it to SwupA11yPlugin() in the function definition on line 147 I don't get any errors now, and I think it is working as I expect.
The problem is here I guess. Shall we just hardcode the correct name? It's there just so it works for plugins created from template out of the box, but this is kind of an exception.