The question is in the title.
Since Webpack is not required we shouldn't install it + dependecies.
I'm in favor of running everything through webpack _now_ - if someone runs wrangler preview right now, they'll still be able to view the single JS script code in the left-hand side of the screen. If we decide to run single JS scripts through webpack later, that'll be a potential degradation of functionality... would rather just have everything webpack-ified and thus (I assume) minified/uglified now versus later
For debugging we shouldn't present the user minified/uglified code, we can take advantage of the sourcemap support! Ideally this would work with non-JavaScript code as well, but well that's another story.
I can easily image a user starting with a simple script and suddently using an import or a npm dep, which would require Webpack. I'm in favor of Webpack'ing all the time.
+1 on relying on a single pipeline and always running through Webpack.
i am ok with webpacking all the time so long as there is a way to force wrangler to use the non webpack pipeline. what do you think the interface for that should be? editing the wrangler.toml? a flag?
I doubt we can reliabilty detect that the user don't want to use Webpack. If the user don't use Webpack's bundling features we still can use it for optimization, minification, transformation if needed, linting, etc.
Most helpful comment
For debugging we shouldn't present the user minified/uglified code, we can take advantage of the sourcemap support! Ideally this would work with non-JavaScript code as well, but well that's another story.
I can easily image a user starting with a simple script and suddently using an
importor a npm dep, which would require Webpack. I'm in favor of Webpack'ing all the time.