See also:


JavaScript module bundler

Server-side rendering with code splitting

How to implement server-side rendering with code splitting?

Server-side rendering makes your website faster for users and search engines. In addition to this, not all crawlers can run JavaScript, so search engines and social platforms may not index or process the content of the website.

Read more

Creating a JavaScript library with webpack

How to bundle a JavaScript library with webpack?

Webpack is a great tool for bundling JavaScript libraries.

The typical webpack.config.js used by a library looks something like this:

const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'main.js',
    libraryTarget: 'commonjs'
  externals: { ... }
Read more