cebg-site/webpack.desktop.js
cebgcontract 8586d3cb64 tmp save
2022-09-28 12:22:24 +08:00

72 lines
2.0 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',
entry: './src/desktop/index.js',
output: {
path: path.resolve(__dirname, 'dist/desktop'),
filename: 'js/[name]-[hash].js',
publicPath: './assets/',
},
module: {
rules: [
{
test: /\.(png|jpg|gif|jpeg|svg)$/,
loader: 'url-loader',
options: {
name: '[name].[hash:5].[ext]',
limit: 1024 * 10,
outputPath: 'img',
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(woff|ttf|svg|eot)$/,
use: ['url-loader'],
},
{
test: /.html$/,
loader: 'html-loader',
options: {
esModule: false,
},
},
{
exclude: /\.(css|js|html|json|less|png|jpg|gif|woff|ttf|svg|eot)$/,
loader: 'file-loader',
},
],
},
plugins: [
// new CopyWebpackPlugin({
// patterns: [
// { from: './src/desktop/css', to: 'css/[name].[contenthash][ext]' },
// { from: './src/desktop/img', to: 'img/[name].[contenthash][ext]' },
// { from: './src/desktop/font', to: 'font[name].[contenthash][ext]' },
// ],
// }),
new htmlWebpackPlugin({
// filename: 'index.html',
template: './src/desktop/index.html',
inject: true,
// title: 'CEBG: CRYPTO ELITES BATTLEGROUNDS',
}),
// new htmlWebpackPlugin({
// filename: 'nft.html',
// template: './src/desktop/nft.html',
// title: 'NFT | CEBG: CRYPTO ELITES BATTLEGROUNDS',
// }),
// new HtmlWebpackTagsPlugin({ tags: ['main.js', 'base.css'], append: true }),
// new MiniCssExtractPlugin({ filename: 'base.css' }),
],
}