This commit is contained in:
ReznoRMichael 2021-01-25 14:50:32 +01:00
parent 1102ab2613
commit a3d5e58c22
4 changed files with 19 additions and 11 deletions

View file

@ -27,7 +27,7 @@
<meta property="twitter:url" content="https://reznormichael.github.io/hollow-knight-completion-check/"> <meta property="twitter:url" content="https://reznormichael.github.io/hollow-knight-completion-check/">
<meta name="author" content="ReznoR Michael"> <meta name="author" content="ReznoR Michael">
<link rel="icon" href="favicon.png"><link href="index.css" rel="stylesheet"></head> <link rel="icon" href="favicon.png"><link href="main.css" rel="stylesheet"></head>
<body> <body>
<div id="background"></div> <div id="background"></div>

View file

@ -1,27 +1,31 @@
/* global require module __dirname */ /* global require module __dirname */
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const {
CleanWebpackPlugin
} = require('clean-webpack-plugin');
module.exports = { module.exports = {
entry: { entry: {
index: './src/js/index.js', index: './src/js/index.js'
}, },
mode: 'development', mode: 'development',
output: { output: {
path: `${__dirname}/docs`, path: `${__dirname}/docs`,
filename: 'app.js', filename: 'app.js',
assetModuleFilename: 'img/[hash][ext][query]', assetModuleFilename: 'img/[hash][ext][query]'
}, },
plugins: [ plugins: [
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new MiniCssExtractPlugin(), new MiniCssExtractPlugin({
filename: 'main.css'
}),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './src/index.html', template: './src/index.html',
inject: true, inject: true,
chunks: ['index'], chunks: ['index'],
filename: 'index.html', filename: 'index.html',
favicon: "./src/favicon.png", favicon: "./src/favicon.png"
}) })
], ],
module: { module: {
@ -31,7 +35,7 @@ module.exports = {
use: { use: {
loader: 'babel-loader', loader: 'babel-loader',
options: { options: {
presets: ['@babel/preset-env'], presets: ['@babel/preset-env']
}, },
}, },
}, },
@ -40,7 +44,7 @@ module.exports = {
use: [{ use: [{
loader: MiniCssExtractPlugin.loader, loader: MiniCssExtractPlugin.loader,
options: { options: {
publicPath: "", publicPath: ""
}, },
}, },
// 'style-loader', // 'style-loader',
@ -50,7 +54,7 @@ module.exports = {
}, },
{ {
test: /\.(svg|jpg|png|ttf|eot|woff|woff2)$/, test: /\.(svg|jpg|png|ttf|eot|woff|woff2)$/,
type: 'asset', type: 'asset'
}, },
], ],
}, },

View file

@ -3,7 +3,9 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const {
CleanWebpackPlugin
} = require('clean-webpack-plugin');
module.exports = { module.exports = {
entry: { entry: {
@ -26,7 +28,9 @@ module.exports = {
}, },
plugins: [ plugins: [
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new MiniCssExtractPlugin(), new MiniCssExtractPlugin({
filename: 'main.css'
}),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './src/index.html', template: './src/index.html',
inject: true, inject: true,