Wrangler: Should we run Webpack for a single JavaScript?

Created on 21 May 2019  路  5Comments  路  Source: cloudflare/wrangler

The question is in the title.

Since Webpack is not required we shouldn't install it + dependecies.

priority - critical question status - PR attached

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 import or a npm dep, which would require Webpack. I'm in favor of Webpack'ing all the time.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

autarc picture autarc  路  4Comments

matthew-petrie picture matthew-petrie  路  4Comments

nickbalestra picture nickbalestra  路  5Comments

simplenotezy picture simplenotezy  路  5Comments

tibotiber picture tibotiber  路  6Comments