Webpack 5 with Material UI Components Boilerplate. Compilation contains basic Material template. Package is using Babel, PostCSS and Sass with a hot dev server. The project is fully configured and ready to generate the final production process.
Beside of that boilerplate basic template has implemented bunch of useful features like:
- custom font,
- custom icons,
- scroll to top,
- partials templates contains independent contents
Global partial modules like:
- analytics (soon)
- hero section (soon),
- footers,
- header contains desktop and mobile navigation supported with Headroom.js feature.
Sample template contains Accordion Module & Swiper Module - features fully compatible witch other Material components.
Working DEMO available at mdpack.vajracode.net
Clone this repo and npm install.
git clone https://github.com/parys-github/material-webpack-boilerplate.git
Instal required NPM modules
npm i
npm start
You can view the development server at localhost:8080
.
npm run build
Note: Install http-server globally to deploy a simple server.
npm i -g http-server
You can view the deploy by creating a server in dist
.
cd dist && http-server
How to setup Webpack 5 - from Scratch
Webpack Official Homepage
Material Web Components
NPM WEB COMPONENTS
Material Layout Grid
Material Responsive Grid
Web Components Catalog
Web Components Usage
Material Icons Library
webpack
- Modules bundler.webpack-cli
- Command line interface for Webpackwebpack-dev-server
- Development server for Webpackwebpack-merge
- Simplify development/production configurationcross-env
- Cross platform configuration
@babel/core
- Transpile ES6+ to backwards compatible JavaScript@babel/plugin-proposal-class-properties
- Use properties directly on a class (an example Babel config)@babel/preset-env
- Smart defaults for Babel
babel-loader
- Transpiling files with Babel and Webpacksass-loader
- Load SCSS and compile to CSSnode-sass
- Node Sasspostcss-loader
- Process CSS with PostCSSpostcss-preset-env
- Sensible defaults for PostCSScss-loader
- Resolve CSS importsstyle-loader
- Inject CSS into the DOM
clean-webpack-plugin
- Remove/clean build folderscopy-webpack-plugin
- Copy files to build directoryhtml-webpack-plugin
- Generate HTML files from templatemini-css-extract-plugin
- Extract CSS into separate filescss-minimizer-webpack-plugin
- Optimize and minimize CSS assets
Accordion
- Silky-smooth accordion widgetAudio.js
- Modern Audio Player widgetHeadroom.js
- Lightweight, high-performance JS widgetSwiperjs
- Most modern mobile touch slider
eslint
- Enforce style guide across applicationeslint-config-airbnb-base
- Base styleguide to enforce ruleseslint-config-prettier
- Implement prettier ruleseslint-plugin-import
- Implement import ruleseslint-plugin-prettier
- Dependency for prettier usage with ESLinteslint-import-resolver-webpack
- Throw exceptions for import/export in webpackeslint-webpack-plugin
- ESLint configuration for webpackprettier
- Dependency forprettier-webpack-plugin
pluginprettier-webpack-plugin
- Prettier configuration for webpack
├── .git/ # git repo
│ └── ...
├── config/ # Webpack configuration directory
│ ├── paths.js # Global paths setup
│ ├── webpack.common.js # Default Webpack configuration file
│ ├── webpack.dev.js # Development build configuration file
│ └── webpack.prod.js # Production build configuration file
├── dist/ # Build directory
│ └── ...
├── node_modules/ # Node library
│ └── ...
├── public/ # Static assets directory
│ └── ...
├── src/ # Project source files
│ ├── fonts/ # Custom fonts
│ │ └── ...
│ ├── img/ # Image assets
│ │ ├── icons/ # Custom icons
│ │ └── ...
│ ├── js/ # JavaScript files
│ │ └── ...
│ ├── scss/ # Sylesheet files
│ │ └── ...
│ └── views/ #
│ ├── content/ # Content (html)
│ │ └── ...
│ ├── partials/ # Partials (html) modules
│ │ ├── components # Partials (html components)
│ │ └── ...
│ ├── templates/ # Pages templates
│ │ └── ... #
│ └── ...
├── .babelrc.json # Presets and plugins conf
├── .eslintrc.json # Conf linting rules file
├── .gitignore # Defaulr ignore
├── .prettierrc.json # Prettier formatting rules
├── LICENSE # MIT License (MIT)
├── package.json # Required modules packages
├── postcss.config.js # Styles transforming conf
└── README.md # Project instruction
This project is open source and available under the MIT License.