This repo holds Webpack skeleton, which has pretty much every functionality that is needed for a web application. Just add your file paths and start coding!
Steps to Reproduce the repo:
sudo npm i webpack webpack-dev-server --save-dev -g
sudo npm i babel babel-core babel-loader babel-preset-es2015 --save-dev
sudo npm i react react-dom --save-dev
sudo npm install babel-core babel-loader jshint jshint-loader eslint-loader node-libs-browser babel-preset-es2015 babel-preset-react babel-preset-react-env --save-dev
sudo npm install babel-loader eslint-loader uglifyjs-webpack-plugin extract-text-webpack-plugin css-loader node-sass sass-loader resolve-url-loader copy-webpack-plugin jquery glob-all --save-dev
Create webpack.config.js file
Declare the plugins needed in config file
Here is the Snippet to add in webpack.config.js file
var webpack = require('webpack');
var path = require('path');
var UglifyJSPlugin = require('uglifyjs-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ConcatPlugin = require('webpack-concat-plugin');
var glob = require("glob-all");
var CopyWebpackPlugin = require('copy-webpack-plugin');
To simplify the webpack, I have written module.exports as array and create multiple objects inside it.
module.exports = [
//SCSS to CSS
{
},
//ES6 to ES5
{
},
//Minify the Files
{
},
//JSHINT
{
},
//Copy
{
}
]
Enter "webpack" in terminal to build the modules
Enter "webpack-dev-server" to run the server, basically to leverage the livereload