When I use riot-tag-loader to webpack my tags, neither riot or route object are defined inside the script area or inline scripts. enter image description here

I have a router tag, and that works with a href hashes. But this way I can't change location programmaticaly. Without webpack works like a charm. Works in the official webpack demo, even after stepping back from es6. My webpack config is much more complex, the hack might be there.

I have created a minimal test case here: https://github.com/zorgoz/psilog.bughunt

Please take a look and advise. Thank you!

1

There are 1 best solutions below

1
On

Set your webpack configuration to automatically load riot-route module whenever route identifier is encountered by using the ProvidePlugin to map the identifier to the module. e.g.

new webpack.ProvidePlugin({
    ...
    riot: 'riot',
    route: ['riot-route', 'default'],
    Popper: ['popper.js', 'default']
})