1. 7

    However, webpack can be so much more.

    What if we could take C# code, and transpile it into JavaScript? What if we could take a YAML configuration file, and create a working program just out of configuration? What if we took an image, and automatically made it cropped and greyscaled?

    I think if you start thinking of Webpack as more of a transpiler, not just a bundler, the true power of Webpack can be seen.

    What is this nonsense? Why would Webpack compile C# code? Why should Webpack do everything? I’d prefer if I wouldn’t need webpack at all! And with dynamic imports coming to ECMAScript, and HTTP/2, soon I won’t.

    1. 1

      Compiling C# code to JS or WebAssembly could be great for making C# libraries or programs usable in the browser or in Node without having to reimplement it.

      While it would be great if we had the benefits of Webpack without Webpack (or an equivalent) that’s not going to happen. Even with HTTP2 and dynamic imports, a bundler like Webpack will be necessary to provide the best case performance. (See this post from Kahn Academy.) You’d just use a smarter bundling strategy to produce small feature related bundles that get dynamically imported.