add webpack snippet
This commit is contained in:
parent
b15ea8fc7c
commit
4428e3cc94
@ -1,4 +1,36 @@
|
||||
Pixel-Art
|
||||
## Pixel-Art
|
||||
```css
|
||||
canvas { image-rendering: crisp-edges; image-rendering: pixelated; }
|
||||
```
|
||||
|
||||
## WebPack
|
||||
`packages.json`
|
||||
```json
|
||||
"scripts": {
|
||||
"start": "webpack serve",
|
||||
"build": "webpack --mode=production"
|
||||
},
|
||||
"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',
|
||||
entry: './js/index.js',
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'app'),
|
||||
filename: 'engine.js',
|
||||
},
|
||||
devServer: {
|
||||
contentBase: path.join(__dirname, 'app'),
|
||||
compress: false,
|
||||
port: 55555,
|
||||
},
|
||||
};
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user