I was using a filesystem-based router that supports querystring parameters.
If I had to guess, the ? in the filename conflicts with Webpack’s old-fashioned loader syntax.
Steps to Reproduce
Name a .marko file with ? somewhere in it. I had ?search.marko.
Attempt to bundle it — I was using it as a route entry point, so it was imported from a .js file.
Behold:
ERROR in ./routes/_router.js 19:0-36
Module not found: Error: Can't resolve './?search.marko?assets' in '~/repo/routes'
@ ./index.js 4:0-40 24:11-24
And if you think ?param.marko is goofy…
The Marko compiler gets confused if the standard directory/index.ext convention is used, since it supports component-name/index.marko. As a result, this router instead has the convention of directory/.marko.
You might be pleasantly surprised to learn that works.
@marko/webpack
version: 7.0.0-2I was using a filesystem-based router that supports querystring parameters.
If I had to guess, the
?
in the filename conflicts with Webpack’s old-fashioned loader syntax.Steps to Reproduce
.marko
file with?
somewhere in it. I had?search.marko
.import
ed from a.js
file.Behold:
And if you think
?param.marko
is goofy…The Marko compiler gets confused if the standard
directory/index.ext
convention is used, since it supportscomponent-name/index.marko
. As a result, this router instead has the convention ofdirectory/.marko
.You might be pleasantly surprised to learn that works.