72 lines
2.0 KiB
JavaScript
72 lines
2.0 KiB
JavaScript
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 ELITE‘S BATTLEGROUNDS',
|
||
}),
|
||
// new htmlWebpackPlugin({
|
||
// filename: 'nft.html',
|
||
// template: './src/desktop/nft.html',
|
||
// title: 'NFT | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS',
|
||
// }),
|
||
|
||
// new HtmlWebpackTagsPlugin({ tags: ['main.js', 'base.css'], append: true }),
|
||
// new MiniCssExtractPlugin({ filename: 'base.css' }),
|
||
],
|
||
}
|