config/JavaScript/README.md

39 lines
897 B
Markdown
Raw Normal View History

2021-07-21 18:09:10 +03:00
## Pixel-Art
```css
canvas { image-rendering: crisp-edges; image-rendering: pixelated; }
```
2021-07-21 18:09:10 +03:00
## WebPack
`packages.json`
```json
"scripts": {
2021-08-29 12:59:18 +03:00
"serve": "webpack serve",
2021-08-09 22:30:45 +03:00
"html": "html-minifier --collapse-whitespace --remove-comments src/index.html --output dist/index.html",
"css": "csso src/styles.css --output dist/styles.css",
"build": "npm run html && npm run css && webpack --mode=production"
2021-07-21 18:09:10 +03:00
},
"devDependencies": {
2021-08-29 12:59:18 +03:00
"webpack": "^5.42.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2"
2021-07-21 18:09:10 +03:00
}
```
`webpack.config.js`
```javascript
const path = require('path');
module.exports = {
2021-08-29 12:59:18 +03:00
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'engine.js',
},
devServer: {
contentBase: path.join(__dirname, 'src'),
compress: false,
port: 55555,
},
2021-07-21 18:09:10 +03:00
};
```