commit bbc08b1e6357de377fd1afb6c7812d95b9a58c7d Author: kuwsh1n Date: Sun Feb 18 02:27:52 2024 +0300 init webpack diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..763301f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..6a03d0c --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +import './style.scss' \ No newline at end of file diff --git a/module.js b/module.js new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..14ce03e --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/style.scss b/style.scss new file mode 100644 index 0000000..d60afbd --- /dev/null +++ b/style.scss @@ -0,0 +1,3 @@ +body { + background-color: blue; +} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..6bff764 --- /dev/null +++ b/webpack.config.js @@ -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 + } +} \ No newline at end of file