This is a simple Webpack project that uses TypeScript and Sass for building a modular frontend. The project is set up to compile TypeScript into JavaScript and Sass into CSS.
Ensure you have Node.js and npm installed on your machine.
-
Clone the repository to your local machine:
git clone https://github.com/your-username/webpack-project.git cd webpack-project -
Install the dependencies:
npm install
To start the development server, run:
npm run serveTo Build the project, run:
npm run buildwebpack-project/
├── src/
│ ├── index.ts # Main TypeScript entry file
│ ├── styles.scss # Sass styles file
├── public/
│ ├── bundle.js # Compiled JavaScript output
│ ├── app.css # Compiled CSS output
├── webpack.config.js # Webpack configuration file
├── package.json # Project dependencies and scripts
└── README.md # Project documentationThe project uses Webpack to bundle TypeScript and Sass files. The configuration includes:
- MiniCssExtractPlugin: Extracts CSS from the JavaScript bundle and outputs it as a separate file.
- ts-loader: Loads and compiles TypeScript files.
- sass-loader: Compiles Sass to CSS.
- css-loader: Converts CSS into CommonJS modules for bundling.