init webpack

This commit is contained in:
kuwsh1n 2024-02-18 02:27:52 +03:00
commit bbc08b1e63
6 changed files with 52 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
dist/
node_modules/

1
index.js Normal file
View File

@ -0,0 +1 @@
import './style.scss'

0
module.js Normal file
View File

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "minerva",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "npx webpack --mode production",
"start": "npx webpack-dev-server --mode development"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"css-loader": "^6.10.0",
"html-webpack-plugin": "^5.6.0",
"sass": "^1.71.0",
"sass-loader": "^14.1.0",
"style-loader": "^3.3.4",
"webpack": "^5.90.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.2"
}
}

3
style.scss Normal file
View File

@ -0,0 +1,3 @@
body {
background-color: blue;
}

23
webpack.config.js Normal file
View File

@ -0,0 +1,23 @@
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
module.exports = {
entry: './index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
clean: true
},
plugins: [new HtmlWebpackPlugin()],
module: {
rules: [
{
test: /\.(scss|css)$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
}
]
},
devServer: {
port: 3000
}
}