Breakout game is based on MDN 2D breakout game using pure JavaScript Tutorial
-
Started with Vanilla JS: plain JavaScript without any additional libraries like jQuery and P5*js
-
ESlint: a tool that flag inconsistent style and suspicious code
* Set up npm: npm init -y * Install ESLint: npm install eslint --save-dev * Setup a config file: npx eslint --init
-
webpack: Bundling processes the sources to reduces file size by removing unnecessary characters, renames elements to obsecure code, Converts .ts files into .js files, Convert ES6 JS into JS that is compatible with older browsers, and finally combining all .js files into a single bundle.js file.
* npm install --save-dev webpack webpack-cli
* |- package.json |- webpack.config.js |- /src |- index.js |- /dist |- index.html
* ```javascript const path = require('path') module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') } } ```
{ ```javascript ... "scripts": { "develop": "webpack --mode development --watch", "build": "webpack --mode production" }, ... } ``` * Bundling project in develop mode: npm run develop * production mode: npm run build