cebg-site/webpack.desktop.js
2022-09-27 16:22:15 +08:00

51 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const path = require('path')
var htmlWebpackPlugin = require('html-webpack-plugin')
var HtmlWebpackTagsPlugin = require('html-webpack-tags-plugin')
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
var CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
mode: 'development',
context: __dirname,
entry: './desktop/js/jquery.min.js',
output: {
path: path.resolve(__dirname, 'dist/desktop'),
filename: 'js/[name]-[hash].js',
publicPath: './',
},
module: {
rules: [
{
test: /\.html$/i,
loader: 'html-loader',
},
{
test: /\.css$/i,
use: ['style-loader', MiniCssExtractPlugin.loader, 'css-loader'],
},
],
},
plugins: [
new htmlWebpackPlugin({
filename: 'index.html',
template: './desktop/index.html',
title: 'CEBG: CRYPTO ELITES BATTLEGROUNDS',
}),
new htmlWebpackPlugin({
filename: 'NFT.html',
template: './desktop/NFT.html',
title: 'NFT | CEBG: CRYPTO ELITES BATTLEGROUNDS',
}),
// new CopyWebpackPlugin({
// patterns: [
// { from: './desktop/css', to: 'css/[name].[contenthash][ext]' },
// { from: './desktop/img', to: 'img/[name].[contenthash][ext]' },
// { from: './desktop/font', to: 'font[name].[contenthash][ext]' },
// ],
// }),
// new HtmlWebpackTagsPlugin({ tags: ['main.js', 'base.css'], append: true }),
new MiniCssExtractPlugin({ filename: 'base.css' }),
],
}