-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated package.json * Added a new look to the index page * Updated .htaccess * Re-indented modernizr config * Regenerated yarn.lock and package.json * Moved development webpack config to a separate file * Removed the need to manually change webpack config on adding a new page * Removed the need to restart webpack-dev-server every time a new page is added or removed * Temporary fix to browser opening on different ports on restart * Fixes restarting and opening of browser on different ports * Change of plans * Added support for sass, enabled source mapping, and added default port to dev-server * Added support for images and fonts, removed cross-env dependency * General improvements and added support for svg images * General improvements and added support for proxying backend server * Updated Readme * Separated production and development common webpack config to a different file, added production webpack config * clean previous builds when rebuilding, css minification improvements * Copy all files that dont get copied in the build process
- Loading branch information
1 parent
6149b75
commit 013b9a1
Showing
18 changed files
with
1,526 additions
and
1,512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,5 @@ module.exports = { | |
"always" | ||
], | ||
"no-console": "off", | ||
"no-unused-vars": "off" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ const entryPoints = { | |
index: [ | ||
"./src/js/index.js", | ||
"./src/css/index.css" | ||
] | ||
], | ||
}; | ||
|
||
module.exports = entryPoints; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const pathToDir = path.join(__dirname, "dist"); | ||
|
||
const cleanDirectory = (path) => { | ||
if (fs.existsSync(path)) { | ||
const files = fs.readdirSync(path); | ||
|
||
if(files.length > 0){ | ||
files.forEach(filename => { | ||
if(fs.statSync(`${path}/${filename}`).isDirectory()) { | ||
cleanDirectory(`${path}/${filename}`); | ||
} | ||
else { | ||
fs.unlinkSync(`${path}/${filename}`); | ||
} | ||
}); | ||
fs.rmdirSync(path); | ||
} | ||
else { | ||
fs.rmdirSync(path) | ||
} | ||
|
||
if (path === pathToDir) { | ||
console.log("Successfully removed previous build and preparing new build..."); | ||
} | ||
} | ||
else { | ||
console.log("No previous build to remove"); | ||
} | ||
}; | ||
|
||
console.log("Removing previous build..."); | ||
cleanDirectory(pathToDir); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
{ | ||
"minify": true, | ||
"options": [ | ||
"domPrefixes", | ||
"prefixes", | ||
"addTest", | ||
"hasEvent", | ||
"mq", | ||
"prefixedCSSValue", | ||
"testAllProps", | ||
"testProp", | ||
"testStyles", | ||
"setClasses" | ||
], | ||
"feature-detects": [ | ||
"test/custom-elements", | ||
"test/history", | ||
"test/pointerevents", | ||
"test/postmessage", | ||
"test/webgl", | ||
"test/websockets", | ||
"test/css/animations", | ||
"test/css/columns", | ||
"test/css/flexbox", | ||
"test/elem/picture", | ||
"test/img/sizes", | ||
"test/img/srcset", | ||
"test/workers/webworkers" | ||
] | ||
"minify": true, | ||
"options": [ | ||
"domPrefixes", | ||
"prefixes", | ||
"addTest", | ||
"hasEvent", | ||
"mq", | ||
"prefixedCSSValue", | ||
"testAllProps", | ||
"testProp", | ||
"testStyles", | ||
"setClasses" | ||
], | ||
"feature-detects": [ | ||
"test/custom-elements", | ||
"test/history", | ||
"test/pointerevents", | ||
"test/postmessage", | ||
"test/webgl", | ||
"test/websockets", | ||
"test/css/animations", | ||
"test/css/columns", | ||
"test/css/flexbox", | ||
"test/elem/picture", | ||
"test/img/sizes", | ||
"test/img/srcset", | ||
"test/workers/webworkers" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,68 @@ | ||
{ | ||
"name": "html5-template", | ||
"version": "1.4.0", | ||
"description": "Basic HTML5 starter template with webpack", | ||
"main": "app.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start": "cross-env NODE_ENV=development webpack-dev-server --mode development", | ||
"build": "cross-env NODE_ENV=production webpack --mode production", | ||
"build:modernizr": "modernizr -c modernizr-config.json -d ./src/js/" | ||
}, | ||
"author": "Ayan Dey", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/whimsicaldreamer/Html5-template.git" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.8.6", | ||
"@babel/plugin-transform-runtime": "^7.8.3", | ||
"@babel/preset-env": "^7.8.6", | ||
"babel-loader": "^8.0.6", | ||
"browser-sync": "^2.26.7", | ||
"browser-sync-webpack-plugin": "^2.2.2", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"copy-webpack-plugin": "^5.1.1", | ||
"cross-env": "^7.0.0", | ||
"css-loader": "^3.4.2", | ||
"cssnano": "^4.1.10", | ||
"eslint": "^6.8.0", | ||
"eslint-loader": "^3.0.3", | ||
"file-loader": "^5.1.0", | ||
"glob-all": "^3.1.0", | ||
"html-loader": "^0.5.5", | ||
"html-webpack-plugin": "^3.2.0", | ||
"image-webpack-loader": "^6.0.0", | ||
"mini-css-extract-plugin": "^0.9.0", | ||
"postcss-loader": "^3.0.0", | ||
"postcss-preset-env": "^6.7.0", | ||
"purify-css": "^1.2.5", | ||
"purifycss-webpack": "^0.7.0", | ||
"webpack": "^4.41.6", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.8.4", | ||
"@fortawesome/fontawesome-svg-core": "^1.2.27", | ||
"@fortawesome/free-brands-svg-icons": "^5.12.1", | ||
"@fortawesome/free-regular-svg-icons": "^5.12.1", | ||
"@fortawesome/free-solid-svg-icons": "^5.12.1", | ||
"jquery": "^3.4.1", | ||
"modernizr": "^3.9.1", | ||
"normalize.css": "^8.0.1" | ||
} | ||
"name": "html5-template", | ||
"version": "1.5.0", | ||
"description": "A no-frills HTML5 starter template with the power of webpack", | ||
"main": "app.js", | ||
"scripts": { | ||
"dev:open": "wait-on tcp:8080 && open-cli http://localhost:8080", | ||
"dev:run": "nodemon --watch app.js --exec webpack-dev-server --config=webpack.dev.config.js", | ||
"start": "run-p dev:open dev:run", | ||
"prebuild": "node cleanBuild.js", | ||
"build": "webpack --config=webpack.prod.config.js", | ||
"build:modernizr": "modernizr -c modernizr-config.json -d ./src/js/" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.8.4", | ||
"jquery": "^3.4.1", | ||
"modernizr": "^3.9.1", | ||
"normalize.css": "^8.0.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.8.6", | ||
"@babel/plugin-transform-runtime": "^7.8.3", | ||
"@babel/preset-env": "^7.8.6", | ||
"babel-loader": "^8.0.6", | ||
"copy-webpack-plugin": "^5.1.1", | ||
"css-loader": "^3.4.2", | ||
"cssnano": "^4.1.10", | ||
"eslint": "^6.8.0", | ||
"eslint-loader": "^3.0.3", | ||
"file-loader": "^5.1.0", | ||
"html-loader": "^0.5.5", | ||
"html-webpack-plugin": "^3.2.0", | ||
"image-webpack-loader": "^6.0.0", | ||
"mini-css-extract-plugin": "^0.9.0", | ||
"nodemon": "^2.0.2", | ||
"npm-run-all": "^4.1.5", | ||
"open-cli": "^5.0.0", | ||
"postcss-loader": "^3.0.0", | ||
"postcss-preset-env": "^6.7.0", | ||
"sass": "^1.26.2", | ||
"sass-loader": "^8.0.2", | ||
"wait-on": "^4.0.1", | ||
"webpack": "^4.41.6", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3", | ||
"webpack-merge": "^4.2.2" | ||
}, | ||
"author": { | ||
"name": "Ayan Dey", | ||
"url": "https://www.linkedin.com/in/dey-ayan/" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/whimsicaldreamer/Html5-template.git" | ||
}, | ||
"keywords": [ | ||
"html", | ||
"html5", | ||
"template", | ||
"starter template", | ||
"webpack", | ||
"html5 template", | ||
"boilerplate", | ||
"css", | ||
"javascript" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
module.exports = { | ||
map: false, | ||
plugins: { | ||
"postcss-preset-env": {}, | ||
"cssnano": {}, | ||
"cssnano": { | ||
preset: ["default", { | ||
discardComments: { removeAll: true } | ||
}] | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"/": { | ||
"target": { | ||
"host": "your-virtual-host-name", | ||
"protocol": "http", | ||
"port": 80 | ||
}, | ||
"changeOrigin": true, | ||
"secure": false | ||
} | ||
} |
Oops, something went wrong.