修改mobile打包流程

This commit is contained in:
cebgcontract 2022-09-28 16:40:08 +08:00
parent 5eb14f26fb
commit 41192dacff
14 changed files with 196 additions and 5415 deletions

View File

@ -5,6 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"desktop": "webpack --config ./webpack.desktop.js", "desktop": "webpack --config ./webpack.desktop.js",
"mobile": "webpack --config ./webpack.mobile.js",
"deploy:prod": "rm -f ./src/.DS_Store && aws s3 sync ./src s3://cebg.games.new --acl public-read --exclude \"pubgv4/*\" --exclude \"release/*\"", "deploy:prod": "rm -f ./src/.DS_Store && aws s3 sync ./src s3://cebg.games.new --acl public-read --exclude \"pubgv4/*\" --exclude \"release/*\"",
"refresh:prod": "aws cloudfront create-invalidation --distribution-id EE4HC9OXEQC7Y --paths \"/*\"" "refresh:prod": "aws cloudfront create-invalidation --distribution-id EE4HC9OXEQC7Y --paths \"/*\""
}, },

View File

@ -18,10 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>404 | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>404 | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/modal.css" />
<style> <style>
h1 { h1 {
font-size: 20px; font-size: 20px;
@ -159,8 +155,10 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/jcchain.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/chain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"
></script>
</body> </body>
</html> </html>

View File

@ -18,11 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>NFT | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>NFT | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/swiper.css" />
<link rel="stylesheet" href="./css/modal.css" />
</head> </head>
<body> <body>
<section class="main"> <section class="main">
@ -557,10 +552,16 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/swiper.min.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/jcchain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
<script type="text/javascript" src="./js/chain.js"></script> crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/swiper@3.4.2/dist/js/swiper.min.js"
integrity="sha256-ShAhm+50eq3u2njxZteHrfMlg/Nh+I1EtHL289p5gIM="
crossorigin="anonymous"
></script>
<script type="text/javascript"> <script type="text/javascript">
var mySwiper = '' var mySwiper = ''
var mySwiper2 = '' var mySwiper2 = ''

View File

@ -18,10 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>Roadmap | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>Roadmap | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/modal.css" />
</head> </head>
<body> <body>
<section class="main"> <section class="main">
@ -142,8 +138,10 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/jcchain.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/chain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"
></script>
</body> </body>
</html> </html>

View File

@ -18,10 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>Tokenomic | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>Tokenomic | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/modal.css" />
</head> </head>
<body> <body>
<section class="main"> <section class="main">
@ -123,7 +119,7 @@
</li> </li>
</ul> </ul>
<div class="tokenomic-p-con" style="padding-top: 20px;"> <div class="tokenomic-p-con" style="padding-top: 20px;">
<img src="imgMobile/TOKENOMIC/02/tcz@2x.png" width="90%" "/> <img src="imgMobile/TOKENOMIC/02/tcz@2x.png" width="90%" />
</div> </div>
</div> </div>
<div class="tokenomic-p-item"> <div class="tokenomic-p-item">
@ -228,9 +224,11 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/jcchain.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/chain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"
></script>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$('.tokenomic-tab-inner li').click(function () { $('.tokenomic-tab-inner li').click(function () {

View File

@ -18,10 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>Gameplay | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>Gameplay | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/modal.css" />
</head> </head>
<body> <body>
<section class="main"> <section class="main">
@ -234,9 +230,11 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/jcchain.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/chain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"
></script>
<script> <script>
// $('#gameVideo').click(function () { // $('#gameVideo').click(function () {
// $('.video-mask').hide() // $('.video-mask').hide()

View File

@ -18,11 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/swiper.css" />
<link rel="stylesheet" href="./css/modal.css" />
</head> </head>
<body> <body>
<section class="main"> <section class="main">
@ -290,10 +285,16 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/swiper.min.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/jcchain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
<script type="text/javascript" src="./js/chain.js"></script> crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/swiper@3.4.2/dist/js/swiper.min.js"
integrity="sha256-ShAhm+50eq3u2njxZteHrfMlg/Nh+I1EtHL289p5gIM="
crossorigin="anonymous"
></script>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
var mySwiper = $('.swiper-container').swiper({ var mySwiper = $('.swiper-container').swiper({

6
src/mobile/js/app.js Normal file
View File

@ -0,0 +1,6 @@
require('../css/base.css')
require('../css/main.css')
require('../css/modal.css')
require('../../../node_modules/swiper/dist/css/swiper.css')
require('./main.js')
require('./chain.js')

View File

@ -1,38 +1,38 @@
$(function () { var jcchain = require('../../desktop/js/jcchain.js')
var chain = new jcchain.JCChain()
var toggleLoginBtn = function () {
if (chain.logined) {
$('#header_loginbtn').hide()
$('#header_logoutbtn').show()
} else {
$('#header_loginbtn').show()
$('#header_logoutbtn').hide()
}
}
toggleLoginBtn()
var logSuccess = function () {
console.log('login success')
toggleLoginBtn()
}
$('#header_loginbtn').click(function () {
chain.login().then(logSuccess.bind(this))
})
$('#header_logoutbtn').click(function () { var chain = new jcchain.JCChain()
chain.logout().then(() => { var toggleLoginBtn = function () {
toggleLoginBtn() if (chain.logined) {
}) $('#header_loginbtn').hide()
}) $('#header_logoutbtn').show()
jcchain.EventBus.$on(jcchain.SHOW_CHAIN_MODAL, function () { } else {
console.log('show chain modal') $('#header_loginbtn').show()
$('#wallet_modal').show() $('#header_logoutbtn').hide()
}) }
$('#metamask_card').click(function () { }
chain.selectWalletAndLogin(1).then(logSuccess.bind(this)) toggleLoginBtn()
$('#wallet_modal').hide() var logSuccess = function () {
}) console.log('login success')
$('#wc_card').click(function () { toggleLoginBtn()
chain.selectWalletAndLogin(2).then(logSuccess.bind(this)) }
$('#wallet_modal').hide() $('#header_loginbtn').click(function () {
chain.login().then(logSuccess.bind(this))
})
$('#header_logoutbtn').click(function () {
chain.logout().then(() => {
toggleLoginBtn()
}) })
}) })
jcchain.EventBus.$on(jcchain.SHOW_CHAIN_MODAL, function () {
console.log('show chain modal')
$('#wallet_modal').show()
})
$('#metamask_card').click(function () {
chain.selectWalletAndLogin(1).then(logSuccess.bind(this))
$('#wallet_modal').hide()
})
$('#wc_card').click(function () {
chain.selectWalletAndLogin(2).then(logSuccess.bind(this))
$('#wallet_modal').hide()
})

File diff suppressed because one or more lines are too long

View File

@ -18,10 +18,7 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>Privacy Policy | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>Privacy Policy | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/modal.css" />
<style> <style>
h1 { h1 {
font-size: 20px; font-size: 20px;
@ -316,8 +313,10 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/jcchain.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/chain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"
></script>
</body> </body>
</html> </html>

View File

@ -18,10 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>Team | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>Team | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/modal.css" />
</head> </head>
<body> <body>
<section class="main"> <section class="main">
@ -227,8 +223,10 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/jcchain.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/chain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"
></script>
</body> </body>
</html> </html>

View File

@ -18,10 +18,6 @@
content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game" content="CEBG, CRYPTO ELITES BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITES, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game"
/> />
<title>Terms | CEBG: CRYPTO ELITES BATTLEGROUNDS</title> <title>Terms | CEBG: CRYPTO ELITES BATTLEGROUNDS</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/base.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/modal.css" />
<style> <style>
h1 { h1 {
font-size: 20px; font-size: 20px;
@ -558,8 +554,10 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="./js/main.js"></script> <script
<script type="text/javascript" src="./js/jcchain.js"></script> src="https://code.jquery.com/jquery-2.2.4.min.js"
<script type="text/javascript" src="./js/chain.js"></script> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"
></script>
</body> </body>
</html> </html>

97
webpack.mobile.js Normal file
View File

@ -0,0 +1,97 @@
const path = require('path')
const glob = require('glob')
var webpack = require('webpack')
const htmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const entryFiles = glob.sync(path.join(__dirname, './src/mobile/*.html'))
const htmlWebpackPlugins = []
entryFiles.map((entryFile) => {
const matchRes = entryFile.match(/src\/mobile\/(.*)\.html$/)
const pageName = matchRes && matchRes[1]
console.log(pageName)
htmlWebpackPlugins.push(
new htmlWebpackPlugin({
template: path.join(__dirname, `./src/mobile/${pageName}.html`),
filename: `${pageName}.html`,
inject: 'body',
}),
)
})
module.exports = {
mode: 'production',
entry: './src/mobile/js/app.js',
output: {
path: path.resolve(__dirname, 'dist/mobile'),
filename: 'js/[name]-[hash].js',
publicPath: './',
assetModuleFilename: 'img/[hash][ext][query]',
},
module: {
rules: [
{
test: /\.(png|jpg|gif|jpeg|svg)$/,
// type: 'asset/resource',
dependency: { not: ['url'] },
loader: 'url-loader',
options: {
name: '[hash].[ext][query]',
limit: 1024 * 10,
outputPath: 'img',
},
},
{
test: /\.(woff|ttf|svg|eot|ico)$/,
use: ['url-loader'],
},
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, { loader: 'css-loader' }],
},
{
test: /.html$/,
loader: 'html-loader',
options: {
esModule: false,
sources: {
list: [
'...',
{
tag: 'a',
attribute: 'data-bigimg',
type: 'src',
},
{
tag: 'a',
attribute: 'data-imgdetail',
type: 'src',
},
],
},
},
},
// {
// exclude: /\.(css|js|html|json|less|png|jpg|gif|woff|ttf|svg|eot)$/,
// loader: 'file-loader',
// },
],
},
plugins: [new MiniCssExtractPlugin()].concat(htmlWebpackPlugins),
optimization: {
splitChunks: {
chunks: 'all',
},
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
new OptimizeCssAssetsPlugin(),
],
},
}