# yukionishi1129/webpack-crash-course architecture

> Architecture diagram of the GitHub repository yukionishi1129/webpack-crash-course, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yukionishi1129/webpack-crash-course
- Repository: https://github.com/yukionishi1129/webpack-crash-course

## Overview

##### Project Type and Purpose
- This is not a full-stack application but a hands-on webpack crash-course “sample project.” Its sole focus is demonstrating how webpack (with various loaders/plugins) transforms front-end source code into optimized bundles, and how one can run it via webpack-dev-server or inside Docker.

##### File Structure Analysis
- Top level: configuration files (.babelrc, .eslintrc.json, webpack.config.js), Docker (docker-compose.yml, docker/app/Dockerfile), package.json
- src/: static assets (index.html, index.js, style.scss/css, utilities.js)
- Build script: webpack via CLI defined in package.json scripts
- No backend or database—pure front-end pipeline.

##### Key README Insights
- Demonstrates incremental webpack features: modules, loaders (css-loader, style-loader, url-loader, sass-loader, babel-loader, eslint-loader), plugins (html-webpack-plugin, mini-css-extract-plugin, uglifyjs, optimize-css-assets, source-map).
- Shows difference between dev (webpack-dev-server) and prod (minification, extraction, compression).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Developer Workspace"
        A1["src/index.html"]:::source
        A2["src/index.js"]:::source
        A3["src/style.scss"]:::source
        A4["src/style.css"]:::source
        A5["src/utilities.js"]:::source
    end

    subgraph "Configuration Files"
        C1["webpack.config.js"]:::config
        C2[".babelrc"]:::config
        C3[".eslintrc.json"]:::config
        C4["package.json"]:::config
        C5[".gitignore"]:::config
        C6["README.md"]:::config
        C7["package-lock.json"]:::config
    end

    B["Webpack Bundler"]:::transform

    A1 --> B
    A2 --> B
    A3 --> B
    A4 --> B
    A5 --> B
    C1 --> B
    C2 --> B
    C3 --> B
    C4 --> B
    C5 --> B
    C6 --> B
    C7 --> B

    subgraph "Loaders"
        L1["babel-loader: transpile JS"]:::transform
        L2["css-loader: resolve CSS imports"]:::transform
        L3["style-loader: inject CSS"]:::transform
        L4["sass-loader: compile SCSS"]:::transform
        L5["url-loader: inline assets"]:::transform
        L6["eslint-loader: lint JS"]:::transform
    end

    B --> L1
    B --> L2
    B --> L3
    B --> L4
    B --> L5
    B --> L6

    subgraph "Plugins"
        P1["html-webpack-plugin: generate HTML"]:::transform
        P2["mini-css-extract-plugin: extract CSS"]:::transform
        P3["uglifyjs-webpack-plugin: minify JS"]:::transform
        P4["optimize-css-assets-webpack-plugin: optimize CSS"]:::transform
        P5["source-map: generate source maps"]:::transform
    end

    L1 --> P1
    L2 --> P2
    L3 --> P2
    L4 --> P2
    L5 --> P4
    L6 --> P5

    P1 --> D["dist/ (bundled assets)"]:::output

    D --> S["webpack-dev-server"]:::server
    D --> DC1["docker-compose.yml"]:::server
    DC1 --> DC2["docker/app/Dockerfile"]:::server
    DC2 --> DC["Docker Container"]:::server

    S --> BROWSER["Browser (localhost:8080)"]:::client
    DC --> BROWSER

    click A1 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/src/index.html"
    click A2 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/src/index.js"
    click A3 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/src/style.scss"
    click A4 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/src/style.css"
    click A5 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/src/utilities.js"
    click C1 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/webpack.config.js"
    click C2 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/.babelrc"
    click C3 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/.eslintrc.json"
    click C4 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/package.json"
    click C5 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/.gitignore"
    click C6 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/README.md"
    click C7 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/package-lock.json"
    click DC1 "https://github.com/yukionishi1129/webpack-crash-course/blob/master/docker-compose.yml"
    click DC2 "https://github.com/yukionishi1129/webpack-crash-course/tree/master/docker/app/Dockerfile"

    classDef source fill:#D0E6FF,stroke:#1E88E5,color:#000
    classDef config fill:#E3F2FD,stroke:#42A5F5,color:#000
    classDef transform fill:#FFE0B2,stroke:#FB8C00,color:#000
    classDef server fill:#C8E6C9,stroke:#43A047,color:#000
    classDef output fill:#E1BEE7,stroke:#8E24AA,color:#000
    classDef client fill:#CE93D8,stroke:#6A1B9A,color:#000
```
