CodHeK / packer

most naive JS bundler ever 📦

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Packer 📦

This repo is a means to replicate JS bundlers (like webpack) in a very simple way to understand how they work on a high level and to get an idea of how HMR works.

Usage:

  • Create packer.config.js in your app you want to bundle.

    module.exports = {
      entry: './src/index.js',
      output: {
          filename: 'index.js'
      }
    };
    
  • Add a build and serve commands to your app package.json.

    "scripts": {
      ...
      "build": "pckr --config packer.config.js",
      "start": "pckr serve"
    },
    
  • Run npm run build and this will create a /build directory in your app root with the bundled file.

OR

  • Run npm run start to start the packer server that looks for file changes and see your app hot reload :D

About

most naive JS bundler ever 📦


Languages

Language:JavaScript 98.7%Language:HTML 1.3%