2021-07-21 18:09:10 +03:00
|
|
|
## Pixel-Art
|
2021-07-02 14:37:33 +03:00
|
|
|
```css
|
|
|
|
canvas { image-rendering: crisp-edges; image-rendering: pixelated; }
|
|
|
|
```
|
2021-07-21 18:09:10 +03:00
|
|
|
|
|
|
|
## WebPack
|
|
|
|
`packages.json`
|
|
|
|
```json
|
|
|
|
"scripts": {
|
2021-08-09 22:30:45 +03:00
|
|
|
"serve": "webpack serve",
|
|
|
|
"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": {
|
|
|
|
"webpack": "^5.42.0",
|
|
|
|
"webpack-cli": "^4.7.2",
|
|
|
|
"webpack-dev-server": "^3.11.2"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
`webpack.config.js`
|
|
|
|
```javascript
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: 'development',
|
2021-08-09 22:30:45 +03:00
|
|
|
entry: './src/index.js',
|
2021-07-21 18:09:10 +03:00
|
|
|
output: {
|
2021-08-09 22:30:45 +03:00
|
|
|
path: path.resolve(__dirname, 'dist'),
|
2021-07-21 18:09:10 +03:00
|
|
|
filename: 'engine.js',
|
|
|
|
},
|
|
|
|
devServer: {
|
2021-08-09 22:30:45 +03:00
|
|
|
contentBase: path.join(__dirname, 'src'),
|
2021-07-21 18:09:10 +03:00
|
|
|
compress: false,
|
|
|
|
port: 55555,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
```
|