Commit d5c8510c authored by 余成's avatar 余成

init

parent b2d68441
node_modules
.history
思维导图地址
https://alidocs.dingtalk.com/i/team/3YxXANaQeaQ3LmNy/docs/3YxXAR7oJbBWLmNy?iframeQuery=mode%3D2
\ No newline at end of file
思维导图地址
https://alidocs.dingtalk.com/i/team/3YxXANaQeaQ3LmNy/docs/3YxXAR7oJbBWLmNy?iframeQuery=mode%3D2
\ No newline at end of file
/*
将此文件放到project/config/scripts/assets/目录下
在package.json文件的"scripts"字段下,分别修改dev和build命令:
"dev": "node ./config/scripts/assets/generateAssetList.js && node ./config/webpack.dev.config.js"
"build": "node ./config/scripts/assets/generateAssetList.js && node ./config/scripts/assets/index.js imgmin imgup && node ./config/webpack.prod.config.js"
*/
const fs = require('fs')
const path = require('path')
/*请先配置:预加载的资源文件夹名称,或者设置预加载、异步加载资源路径*/
const preloadFolder = ['loading']; //在/src/assets文件夹下,请设置需要预加载的资源文件目录,默认值预加载为loading文件夹, 其他均为异步加载
const initAssetList = { //初始化预设资源处理
preLoadImg:[], //设置预加载图片,例如:["loading/bg174.png","loading/上面.png","loading/底部173.png"]
asyncLoadImg:[] //设置异步加载图片
}
/**
* 搜索文件夹里的文件
* @param {*} folderList 预加载文件夹名称数组
* @param {*} folderPath 文件夹地址,绝对路径
* @param {*} regExp 正则表达式,用于匹配目标文件
* @returns {string[]} 返回文件相对路径地址
*/
function searchFileFromFolder(folderPath='/src/assets', regExp=/\.(png|jpg|jpeg|svga|spi|json|mp3|wav)$/i) {
let preLoadImg = [], asyncLoadImg = [];
const searchOneDir = (absolutePath, relativePath) => {
fs.readdirSync(absolutePath).forEach(v => {
let absPath = absolutePath + '/' + v;
let relPath = relativePath ? relativePath + '/' + v : v;
if(fs.statSync(absPath).isFile()) {
if(regExp.test(v)){
if(preloadFolder.includes(relPath.split('/')[0])){
preLoadImg.push(relPath);
}else{
asyncLoadImg.push(relPath)
}
}
}else {
searchOneDir(absPath, relPath);
}
});
}
searchOneDir(path.resolve('.') + folderPath, '');
console.log('资源预处理成功~')
return {
preLoadImg: [
...initAssetList.preLoadImg,
...preLoadImg
],
asyncLoadImg: [
...initAssetList.asyncLoadImg,
...asyncLoadImg
]
};
}
// 读资源目录
const assetList = searchFileFromFolder();
// 写资源列表json
fs.writeFileSync(path.resolve('.') + '/src/assetList.json', JSON.stringify(assetList))
\ No newline at end of file
const { assets } = require("spark-assets");
const args = process.argv.splice(2);
let argsObj = {
imgmin: false,
imgup: false
}
if (args.length == 1) {
argsObj.imgmin = 'imgmin' == args[0];
argsObj.imgup = 'imgup' == args[0];
} else if (args.length == 2) {
argsObj.imgmin = 'imgmin' == args[0];
argsObj.imgup = 'imgup' == args[1];
}
assets(argsObj)
\ No newline at end of file
exports.SPARK_CONFIG_DIR_KEY = ['OUTPUT_DIR', 'SOURCE_DIR', 'TEMP_DIR', 'ENTRY', 'TEMPLATE']
exports.SPARK_CONFIG = 'sparkrc.js'
//对应项目在线素材存储的cdn配置,用于迭代开发从线上拉取素材到本地
exports.SPARK_CDN_RES_CFG='sparkrescfg.json'
\ No newline at end of file
const loaderUtils = require('loader-utils');
module.exports = function (source) {
const options = loaderUtils.getOptions(this);
let result = source;
if (options.arr) {
options.arr.map(op => {
result = result.replace(op.replaceFrom, op.replaceTo);
})
} else {
result = source.replace(options.replaceFrom, options.replaceTo);
}
return result
};
const babel = require('@babel/core');
const HtmlWebpackPlugin = require("html-webpack-plugin");
class HtmlJsToES5Plugin {
process(htmlPluginData) {
return new Promise(function (resolve) {
const scriptRegExp = /<script>[\s\S]*?<\/script>/gis;
htmlPluginData.html = htmlPluginData.html.replace(scriptRegExp, function (match) {
const code = match.replace("<script>", "").replace("</script>", "");
const es5Code = babel.transform(code, { 'presets': ['@babel/preset-env'] }).code;
return `<script>${es5Code}</script>`;
});
resolve();
});
};
apply(compiler){
compiler.hooks.compilation.tap('HtmlJsToES5Plugin', (compilation) => {
HtmlWebpackPlugin.getHooks(compilation).afterTemplateExecution.tapAsync(
"HtmlJsToES5Plugin",
async (html, cb) => {
await this.process(html);
cb(null, html);
}
);
});
}
}
// exports.default = HtmlJsToES5Plugin;
module.exports = HtmlJsToES5Plugin;
// 端口是否被占用
exports.getProcessIdOnPort=function(port) {
try {
const execOptions = {
encoding: 'utf8',
stdio: [
'pipe',
'pipe',
'ignore',
],
};
return execSync('lsof -i:' + port + ' -P -t -sTCP:LISTEN', execOptions)
.split('\n')[0]
.trim();
} catch (e) {
return null;
}
}
const childProcessSync=async function(cmd, params, cwd, printLog = true) {
return new Promise((resolve, reject) => {
let proc = childProcess(cmd, params, cwd, printLog);
proc.on('close', (code) => {
if (code === 0) {
resolve(proc['logContent']);
} else {
reject(code);
}
});
});
}
const getGitBranch=async function(cwd) {
try {
const result = await childProcessSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], cwd, false);
if (!result.startsWith('fatal:')) {
return result.trim();
}
} catch (e) {
return undefined;
}
}
const getProjectNameByPackage=function() {
return require(`${process.cwd()}/package.json`).name
}
/**
* 理论上每个项目独一无二的文件夹名字-默认取分支名
* 如果当前未创建分支,取包名+日期
* (实际很多情况是直接clone老项目,包名相同,以防资源被替换,所以用日期加一下)
*/
exports.getCdnFolderName=async function() {
const branch = await getGitBranch(process.cwd());
const date = Date.now();
if (branch) {
return branch + "/" + date;
}
let foldername = getProjectNameByPackage() + "/" + date;
return foldername;
}
\ No newline at end of file
const path = require('path');
const fs = require("fs");
const { SPARK_CONFIG_DIR_KEY, SPARK_CONFIG } = require('./scripts/constant');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const ProgressBarPlugin = require("progress-bar-webpack-plugin");
module.exports = function (isProd) {
const appPath = process.cwd();
const sparkConfig = require(path.join(appPath, SPARK_CONFIG));
const isEslint = fs.existsSync(`${appPath}/.eslintrc.js`);
const cssReg = /\.(css|less)$/;
// 处理相对路径
SPARK_CONFIG_DIR_KEY.map((key) => {
sparkConfig[key] = path.resolve(appPath, sparkConfig[key]);
});
const stylePlugins = [
require("autoprefixer")({
overrideBrowserslist: ["> 1%", "last 2 versions", "not ie <= 8"],
})
];
if (sparkConfig.PX2REM) {
stylePlugins.push(
require("postcss-px2rem-exclude")({
remUnit: 100, // 注意算法,这是750设计稿,html的font-size按照750比例
exclude: /node_modules/i,
})
);
}
const styleLoader = (cssOptions = {}) => {
return [
{
loader: "style-loader",
},
isProd && {
loader: MiniCssExtractPlugin.loader,
options: {
esModule: false,
},
},
{
loader: "css-loader",
options: {
...cssOptions,
importLoaders: 2, // 如果遇到css里面的 @import 执行后面两个loader。 不然如果import了less,css-loader是解析不了
},
},
{
loader: "postcss-loader",
options: {
sourceMap: !isProd,
plugins: stylePlugins,
},
},
{
loader: require.resolve("less-loader"),
options: {
sourceMap: !isProd,
lessOptions: {
modifyVars: {
"@RES_PATH": `"${isProd ? sparkConfig.RES_PATH_PROD + '/' : sparkConfig.RES_PATH}"`,
},
}
},
},
].filter(Boolean);
};
return {
entry: sparkConfig.ENTRY,
mode: isProd ? 'production' : 'development',
devtool: isProd ? "source-map" : "cheap-module-source-map",
output: {
path: path.resolve(__dirname, sparkConfig.OUTPUT_DIR),
filename: "js/[name].js",
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
alias: {
"@src": path.resolve(__dirname, sparkConfig.SOURCE_DIR),
},
},
module: {
rules: [
// 提前进行eslint, 默认从下往上,通过enforce pre提前
isEslint && {
test: /\.js|jsx/,
enforce: "pre",
loader: "eslint-loader",
options: {
cache: true,
formatter: require("eslint-friendly-formatter"),
fix: true,
failOnError: true,
configFile: `${appPath}/.eslintrc.js`,
},
include: sparkConfig.SOURCE_DIR,
},
{
test: cssReg,
use: styleLoader(),
include: sparkConfig.SOURCE_DIR,
},
{
test: /\.(js|jsx)$/,
loader: require.resolve("babel-loader"),
exclude: [path.resolve("node_modules")],
options: {
presets: [
require("@babel/preset-env").default,
require("@babel/preset-react").default,
],
plugins: [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose": false }],
require("@babel/plugin-transform-runtime").default,
],
sourceType: 'unambiguous'
},
},
{
test: [/\.(jpg|jpeg|png|svg|bmp)$/, /\.(eot|woff2?|ttf|svg)$/],
loader: require.resolve("url-loader"),
options: {
name: "[path][name].[ext]", // name默认是加上hash值。这里做了更改,不让加
outputPath: "images",
limit: 10240, // url-loader处理图片默认是转成base64, 这里配置如果小于10kb转base64,否则使用file-loader打包到images文件夹下
},
},
].filter(Boolean),
},
plugins: [
isProd &&
new MiniCssExtractPlugin({
filename: "styles/[name].[hash].css",
}),
new HtmlWebpackPlugin({
template: sparkConfig.TEMPLATE,
minify: !sparkConfig.UNMINIFY_INDEX && isProd,
}),
new CleanWebpackPlugin({
// cleanOnceBeforeBuildPatterns:['**/*', 'dist'] // 这里不用写 是默认的。 路径会根据output 输出的路径去清除
}),
new ProgressBarPlugin(),
].filter(Boolean),
optimization: {
minimize: isProd,
minimizer: [
// 替换的js压缩 因为uglifyjs不支持es6语法,
new TerserPlugin({
cache: true,
sourceMap: !isProd,
extractComments: false, // 提取注释
parallel: true, // 多线程
terserOptions: {
compress: {
pure_funcs: [
//"console.log"
],
},
},
}),
// 压缩css
new OptimizeCSSAssetsPlugin({
assetNameRegExp: /\.optimize\.css$/g,
cssProcessor: require("cssnano"),
cssProcessorPluginOptions: {
preset: ["default", { discardComments: { removeAll: true } }],
},
canPrint: true,
}),
],
// 修改文件的ids的形成方式,避免单文件修改,会导致其他文件的hash值变化,影响缓存
moduleIds: "hashed",
splitChunks: {
chunks: "all",
minSize: 30000, //小于这个限制的会打包进Main.js
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10, // 优先级权重,层级 相当于z-index。 谁值越大权会按照谁的规则打包
name: "vendors",
},
},
},
// chunks 映射关系的 list单独从 app.js里提取出来
runtimeChunk: {
name: (entrypoint) => `runtime-${entrypoint.name}`,
},
},
};
}
const {SPARK_CONFIG} = require("./scripts/constant");
const Webpack = require("webpack");
const webpackBaseConfig = require("./webpack.common.config");
const WebpackMerge = require("webpack-merge");
const WebpackDevServer = require("webpack-dev-server");
const apiMocker = require('mocker-api');
const path = require('path');
const {getProcessIdOnPort} = require("./scripts/utils");
const sparkConfig = require(path.resolve(SPARK_CONFIG));
const webpackDevConfig = function (options) {
let {port} = options;
return {
devServer: {
useLocalIp: true,
open: true,
hot: true,
host: "0.0.0.0",
disableHostCheck: true,
port: port,
headers: {
'Access-Control-Allow-Origin': '*'
},
// hotOnly: true
before(app) {
if (sparkConfig.API_MOCK) {
apiMocker(app, path.resolve('./mock/index.js'), {
changeHost: true,
})
}
}
},
plugins: [
// new Webpack.WatchIgnorePlugin([/[\\/]mock[\\/]/]),
new Webpack.HotModuleReplacementPlugin()
]
};
};
const buildDev = async function (options) {
let {port} = options;
return new Promise((resolve, reject) => {
const config = WebpackMerge(webpackBaseConfig(false), webpackDevConfig(options));
const compiler = Webpack(config);
const devServerOptions = Object.assign({}, config.devServer);
console.log('devServerOptions', devServerOptions);
const server = new WebpackDevServer(compiler, devServerOptions);
if (getProcessIdOnPort(port)) {
reject(`端口 ${port} 已被使用`);
return;
} else {
server.listen(
port || 8088,
"0.0.0.0",
() => {
console.log(`Starting server on http://localhost:${port}`);
resolve();
},
(err) => {
if (err) console.error("server linsten err--", err);
reject();
}
);
}
});
};
const args = process.argv.splice(2);
const port = args[0] || 8088
buildDev({
port: Number(port)
})
const path = require("path");
const chalk = require("chalk");
const fs = require('fs-extra');
const Webpack = require("webpack");
const WebpackMerge = require("webpack-merge");
const webpackBaseConfig = require("./webpack.common.config");
const {uploadFiles} = require("spark-assets");
const {BundleAnalyzerPlugin} = require("webpack-bundle-analyzer");
const isProd = true;
const {getCdnFolderName} = require("./scripts/utils");
const {SPARK_CONFIG} = require("./scripts/constant");
const HtmlJsToES5Plugin = require("./scripts/plugins/HtmlJsToES5Plugin");
const {DepReporter} = require('spark-log-event');
const sparkConfig = require('../sparkrc');
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
const webpackProdConfig = function (cdnFolderName, resPathProd) {
return {
output: {
publicPath: `//yun.duiba.com.cn/spark/v2/${cdnFolderName}/`,
filename: isProd ? "js/[name].[contenthash:8].js" : "js/[name].[contenthash:4].js",
},
resolveLoader: {
modules: ['node_modules', path.resolve(__dirname, './scripts/loaders')]
},
module: {
rules: [
{
test: /sparkrc\.js$/,
exclude: [path.resolve("node_modules")],
use: [
{
loader: 'replaceLoader',
options: {
arr: [
{
replaceFrom: /(MOCK_STATUS: true)|(MOCK_STATUS:true)|("MOCK_STATUS": true)|("MOCK_STATUS":true)/,
replaceTo: '"MOCK_STATUS": false'
},
{
replaceFrom: /(RES_PATH:.*,)|("RES_PATH":.*,)|('RES_PATH':.*,)/,
replaceTo: `"RES_PATH":"${resPathProd}/",`
}
]
}
}
]
}
]
},
plugins: [
new Webpack.IgnorePlugin(/[\\/]mock[\\/]/),
new ScriptExtHtmlWebpackPlugin({
custom: {
test: /\.js$/,
attribute: 'crossorigin',
value: 'anonymous'
}
}),
new HtmlJsToES5Plugin(),
new DepReporter(),
new BundleAnalyzerPlugin({
analyzerMode: 'disabled'
}),
],
node: {
crypto: 'empty'
}
};
};
const buildProd = async function () {
const cdnFolderName = await getCdnFolderName();
const appPath = process.cwd();
const sparkConfig = require(path.join(appPath, SPARK_CONFIG));
const _webpackProdConfig = await webpackProdConfig(cdnFolderName, sparkConfig.RES_PATH_PROD || '');
//新增 JS_PATH_PROD 用作
let newSparkCfg = Object.assign({}, sparkConfig);
newSparkCfg['JS_PATH_PROD'] = `https://yun.duiba.com.cn/spark/v2/${cdnFolderName}/js`;
let str = `
const page = process.env.PAGE || 'index'
console.log('Current page:', page)
module.exports = ${JSON.stringify(newSparkCfg, null, 2)}
`;
str = str.replace(/"dist\/.*"/, '`dist/${page}`')
.replace(/"src\/.*.jsx"/, '`src/${page}.jsx`')
.replace(/".\/public\/.*.html"/, '`./public/${page}.html`')
fs.writeFileSync(path.join(appPath, SPARK_CONFIG), str);
return new Promise((resolve, reject) => {
const config = WebpackMerge(webpackBaseConfig(isProd), _webpackProdConfig);
const compiler = Webpack(config);
compiler.run(async (error, stats) => {
if (error) {
return reject(error);
}
console.log(
stats.toString({
chunks: false, // 使构建过程更静默无输出
colors: true, // 在控制台展示颜色
})
);
console.log(`${chalk.yellow("打包成功, 等待上传")}\n`);
// await uploadFiles(config.output.path, '', cdnFolderName);
await uploadFiles(config.output.path, '', cdnFolderName, /.map$/);
// 上传map到不同路径,避免泄漏源码
await uploadFiles(
config.output.path + "/js",
'js/map_123_map',
cdnFolderName,
/.(js|css|css\.map)$/
);
resolve();
});
});
};
buildProd();
This diff is collapsed.
This diff is collapsed.
{
"compilerOptions": {
"experimentalDecorators": true,
"baseUrl": "./",
"paths": {
"@src/*": ["src/*"]
}
},
"exclude": [
"node_modules"
]
}
\ No newline at end of file
module.exports = {
"POST /checkin_1/doSign.do": {
"code": null,
"data": {
"extra": null,
"index": 1,
"options": [
{
"index": 1,
"optionId": "o693fc73e",
"optionImg": null,
"optionName": "游戏x1",
"position": null,
"prizeId": "sp_1",
"prizeType": 1,
"ruleId": "ru_1",
"url": "null18520"
}
],
"sendPrize": true,
"timestamp": 1616984151024
},
"message": null,
"success": true
},
"/checkin_1/query.do": {
"code": null,
"data": {
"endTime": "2021-12-30 23:59:59",
"extra": null,
"signDay": 3,
"signDays": [
"2021-12-17 12:12:12",
"2021-12-18 12:12:12",
"2021-12-19 12:12:12"
],
"startTime": "2021-12-17 00:00:00",
"startTimestamp": 1616996546935,
"endTimestamp": 1616996546935,
"timestamp": Date.now(),
"todayAwardPrize": false,
"todaySign": false,
"optionRuleType": 2,
"intervalType": 5,
"intervalDays": 7,
"statType": 1
},
"message": null,
"success": true
},
"/checkin_1/queryOptions.do": {
"code": null,
"data": Array(7).fill('').map((it,index)=>{
return {
"index": index+1,
"options": [
{
"degree": null,
"icon": '//yun.duiba.com.cn/polaris/XHS_15976792349090734a808-3da0-3b7b-85f3-7569cb2d6a80.c3737241e516be765b74eebb0245d491431d8b26.jpg',
"icon2": null,
"id": "o79a0b9d2",
"index": index+1,
"name": "抽奖奖品",
"prizeId": "sp_1",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": 1
}
],
"ruleId": "ru_1"
}
}),
"message": null,
"success": true
}
}
\ No newline at end of file
module.exports = {
"/projectRule.query": {
data: "<p>以下是游戏规则:手速要快,点击红包雨。。333。。。。。。。。。。。。。。。。。。。。11111111111111sadasdadadsad5555555557777777777799999999999911111111111111111111111222222222222222222222222222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333333311111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333331111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333333333333</p>",
success: true
},
"/buriedPoint": {
data: {},
success: true
},
}
module.exports = {
'GET /coop_frontVariable.query': {
"success": true,
"message": "这是返回",
"code": null,
"data": {
callAppUrl: 'https://mywap2.icbc.com.cn/ICBCWAPBank/servlet/WAPBAppInject?injectMenuId=conformity',
defaultAvatarImg: 'https://yun.duiba.com.cn/zengkaiwen/cmsSpring/default_avatar.png', // 默认头像图片
shareImg: 'https://yun.duiba.com.cn/zengkaiwen/cmsSpring/cmsShare.png', // 分享缩略图
iosDownloadUrl: 'https://apps.apple.com/cn/app/cams-plus/id1492244351', // iOS安装包下载链接
androidDownloadUrl: 'https://webcdn.m.qq.com/webapp/homepage/index.html#/appDetail?apkName=com.ezia.mobile.ezia_mobile_cams&info=FEBEDACB3DD683723E67C7AAC08C86BA', // 安卓安装包下载链接
lookMoreUrl: "https://www.baidu.com", //首页底部查看更多url
taskViewTime: 15,
}
}
}
\ No newline at end of file
module.exports = {
"POST /exchange_1/doExchange.do": {
"success": true,
"code": "200104",
"data": {
"optionId": "qwecas",
"optionName": "商品文案内容",
"optionImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": "1",
"position": "1",
"userRecordId": "123",
"url": "www.baidu.com",
"sendCount": "1",
"extra": ""
}
},
"/exchange_1/listExchangeLimit.do": {
"data": {
"limitType": 1,
"exchangeLimitCount": 2,
"extra": "{\"1\":6,\"2\":5}",
"conditions": [
{
"gear": 1,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 888,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
{
"spId": "sp_1",
"quantity": 1,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
}
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "奖品名称奖品名称奖品名称奖品名称",
"optionStock": 1343,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 0
}
]
},
{
"gear": 2,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 666,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
}
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 0,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 0
}
]
},
{
"gear": 3,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 88,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 1340,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 1
}
]
},
{
"gear": 4,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 999,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 0,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 1
}
]
},
{
"gear": 1,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 1,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 1,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 1
}
]
},
{
"gear": 1,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 888,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
{
"spId": "sp_1",
"quantity": 1,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
}
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "奖品名称奖品名称奖品名称奖品名称",
"optionStock": 1343,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 0
}
]
},
{
"gear": 2,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 666,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
}
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 0,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 0
}
]
},
{
"gear": 3,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 88,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 1340,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 1
}
]
},
{
"gear": 4,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 999,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 0,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 1
}
]
},
{
"gear": 1,
"consumeSps": [
{
"spId": "sp_1",
"quantity": 1,
"spName": "道具名称",
"spImg": "http://yun.duiba.com.cn/polaris/丝倍亮小型犬幼年年期全价犬粮7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg"
},
],
"options": [
{
"ruleId": "ru_1",
"optionId": "123",
"optionName": "狗粮",
"optionStock": 1,
"optionImg": "http://yun.duiba.com.cn/polaris/%E4%B8%9D%E5%80%8D%E4%BA%AE%E5%B0%8F%E5%9E%8B%E7%8A%AC%E5%B9%BC%E5%B9%B4%E5%B9%B4%E6%9C%9F%E5%85%A8%E4%BB%B7%E7%8A%AC%E7%B2%AE7.5kg.c27e9ef4b4d418e8a90faa76798e20cb4f18a490.jpg",
"prizeId": "123",
"prizeType": 2,
"userLimitCount": 1,
"alreadyUserCount": 1
}
]
}
]
},
"success": true,
},
"/exchange_1/exchangeAuth.do": {
"success": true,
"data": {
"canExchange": true,
"extra": ""
}
}
}
\ No newline at end of file
const proxy = {
...require('./common'),
...require('./project'),
...require('./checkin'),
...require('./task'),
...require('./exchange'),
...require('./newGuide'),
...require('./lottery'),
...require('./tomorrowAward'),
...require('./coopFrontVariable')
};
module.exports = proxy;
module.exports = {
"/lottery/info.do"(req, res) {
const now = Date.now()
return res.json({
"code": null,
"data": {
"cardList": [
{
"open": true,
"icon": "src/assets/ScratchCardPopup/222.png"
},
{
"open": false,
"unLockTime": now + 1000,
},
{
"open": false,
},
{
"open": false,
},
{
"open": false,
},
{
"open": false,
},
],
"nowTime": now,
"prizeList": [
{
"icon": "src/assets/ScratchCardPopup/111.png",
"name": "奖品名称"
},
{
"icon": "src/assets/ScratchCardPopup/222.png",
"name": "奖品名称"
},
{
"icon": "src/assets/ScratchCardPopup/333.png",
"name": "奖品名称"
},
{
"icon": "src/assets/ScratchCardPopup/333.png",
"name": "奖品名称"
},
{
"icon": "src/assets/ScratchCardPopup/333.png",
"name": "奖品名称"
},
{
"icon": "src/assets/ScratchCardPopup/333.png",
"name": "奖品名称"
},
{
"icon": "src/assets/ScratchCardPopup/333.png",
"name": "奖品名称"
}
],
"awardNum": 888888,
"defaultPrizeName": '38888元现金',
},
"message": null,
"success": true
})
},
"/lottery/open.do": {
"code": null,
"data": {
"optionImg": "src/assets/ScratchCardPopup/222.png",
"optionName": "奖品名称",
"prizeId": "sp_speed_up_1-60",
sendCount: 100,
},
"message": null,
"success": true
},
}
let alreadyGuideSteps = 7
module.exports = {
"/newGuide_1/queryNewGuide.do"(req, res) {
return res.json({
"success": true,
"code": "",
"data": {
"skipNewGuide": true,
"completeGuide": true,
"alreadyGuideSteps": alreadyGuideSteps,
"allGuideSteps": 7,
"extra": ""
}
})
},
"POST /newGuide_1/stepNewGuide.do"(req, res) {
return res.json({
"success": true,
"code": "",
"data": {
"completeGuide": true,
"alreadyGuideSteps": ++alreadyGuideSteps,
"allGuideSteps": 7,
"extra": ""
}
})
},
}
This diff is collapsed.
module.exports = {
"/task_1/queryTasks.do": {
"code": null,
"data": {
"endTimestamp": 1625998052000,
"item": [
{
"buttonText": "1",
"code": "level_1",
"completedSize": 0,
"desc": "1",
"extra": null,
"icon": "",
"id": "fnddp53v",
"index": null,
"indexes": null,
"intervalLimitSize": 3,
"intervalType": 1,
"jumpUrl": "//yun.dui88.com/saas/images/2.0/clcard/bg-share.png",
"options": [
{
"degree": null,
"icon": "//yun.duiba.com.cn/polaris/Custom-Blank-Plain-Cotton-Tshirts-Printing-Tee-Shirt-Wholesale-Men-Printed-T-Shirts (1).bc63390f90dc640f9d096e899d3ea6b5639f12e7.png",
"icon2": "//yun.duiba.com.cn/polaris/20210304083949.b0f9e30881f7b57360d88496f605af2b3360fb8c.jpg",
"id": "o0bca7d6a",
"index": 1,
"name": "金币生成速度",
"prizeId": "sp_1",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": 1
}
],
"playwayId": "task_1",
"prizePendingCode": null,
"prizePendingCodeList": null,
"ruleId": "ru_1",
"sendPrize": null,
"subTitle": "任务副标题任务副标题任务副标题任务副标题任务副标题",
"title": "任务主标题主标题任务主标题主标题任务主标题主标题任务主标题主标题"
},
{
"buttonText": "2",
"code": "watch_1",
"completedSize": 0,
"desc": "2",
"extra": null,
"icon": "//yun.duiba.com.cn/polaris/164680820515613901622010526_.pic.d9e70564baef930a956bef54ed227b6e6114f526.jpg",
"id": "hhfud0u11",
"index": null,
"indexes": null,
"intervalLimitSize": 4,
"intervalType": 1,
"jumpUrl": "//yun.dui88.com/saas/images/2.0/clcard/bg-share.png",
"options": [
{
"degree": null,
"icon": "//yun.duiba.com.cn/polaris/主图-03.1af1dc5482b5278c0fff2abc61376b4d1074768b.jpg",
"icon2": "//yun.duiba.com.cn/polaris/主图-04.8cdf3453458b088a15e1406714cf20800f9ad184.jpg",
"id": "oecba0c9c",
"index": 1,
"name": "钻石",
"prizeId": "sp_2",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": '1'
}
],
"playwayId": "task_1",
"prizePendingCode": 4545,
"prizePendingCodeList": null,
"ruleId": "ru_2",
"sendPrize": null,
"subTitle": "2",
"title": "2"
},
{
"buttonText": "2",
"code": "watch_1",
"completedSize": 1,
"desc": "2",
"extra": null,
"icon": "//yun.duiba.com.cn/aurora/assets/59856c9a347fa02bce37e9dfead8cf0469df4971.png",
"id": "hhfud0u12",
"index": null,
"indexes": null,
"intervalLimitSize": 4,
"intervalType": 1,
"jumpUrl": "//yun.dui88.com/saas/images/2.0/clcard/bg-share.png",
"options": [
{
"degree": null,
"icon": "//yun.duiba.com.cn/polaris/主图-03.1af1dc5482b5278c0fff2abc61376b4d1074768b.jpg",
"icon2": "//yun.duiba.com.cn/polaris/主图-04.8cdf3453458b088a15e1406714cf20800f9ad184.jpg",
"id": "oecba0c9c",
"index": 1,
"name": "钻石",
"prizeId": "sp_2",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": '1'
}
],
"playwayId": "task_1",
"prizePendingCode": null,
"prizePendingCodeList": null,
"ruleId": "ru_2",
"sendPrize": null,
"subTitle": "2",
"title": "2"
},
{
"buttonText": "2",
"code": "third_1",
"completedSize": 0,
"desc": "2",
"extra": null,
"icon": "//yun.duiba.com.cn/aurora/assets/59856c9a347fa02bce37e9dfead8cf0469df4971.png",
"id": "hhfud0u13",
"index": null,
"indexes": null,
"intervalLimitSize": 4,
"intervalType": 1,
"jumpUrl": "//yun.dui88.com/saas/images/2.0/clcard/bg-share.png",
"options": [
{
"degree": null,
"icon": "//yun.duiba.com.cn/polaris/主图-03.1af1dc5482b5278c0fff2abc61376b4d1074768b.jpg",
"icon2": "//yun.duiba.com.cn/polaris/主图-04.8cdf3453458b088a15e1406714cf20800f9ad184.jpg",
"id": "oecba0c9c",
"index": 1,
"name": "钻石",
"prizeId": "sp_2",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": '1'
}
],
"playwayId": "task_1",
"prizePendingCode": null,
"prizePendingCodeList": null,
"ruleId": "ru_2",
"sendPrize": null,
"subTitle": "2",
"title": "2"
}
],
"startTimestamp": 1622023652000,
"timestamp": 1624431392033
},
"message": null,
"success": true
},
"POST /task_1/doCompleted.do": {
"code": null,
"data": {
"buttonText": "1",
"code": "1",
"desc": "1",
"extra": null,
"icon": null,
"id": "3b8mxhjo",
"options": [
{
"extra": null,
"optionId": "o693fc73e",
"optionImg": null,
"optionName": "游戏x1",
"position": null,
"prizeId": "sp_1",
"prizeType": 1,
"ruleId": "ru_1",
"sendCount": null,
"url": "null24155",
"userRecordId": 24155
}
],
"prizePendingCode": null,
"sendPrize": true,
"timestamp": 1619146587178,
"title": "1"
},
"message": null,
"success": true
},
"POST /task_1/sendPrize.do": {
"code": null,
"data": {
"extra": null,
"options": [
{
"optionId": "o693fc73e",
"optionImg": null,
"optionName": "游戏x1",
"position": null,
"prizeId": "sp_1",
"prizeType": 1,
"ruleId": "ru_1",
"url": "null18519"
}
]
},
"message": null,
"success": true
}
}
\ No newline at end of file
const moment = require("moment");
module.exports = {
"/tmrAward_1/showIncomeByCoin.do": {
"success": true,
"code": "aaa",
"data": {
"nextTargetQuantity": 500,
"limit": 1000,
"quantity": 200, // todo
"guidePop": false,
"doublePop": false,
"limitPop": false,
}
},
"/tmrAward_1/showIncome.do"(req, res) {
const thisMoment = moment()
return res.json({
"success": true,
"code": "",
"data": {
"timestamp": 1,
"options": [
{
"incomeId": 213,
"prizeId": "sp_1",
"prizeName": "simbaTest",
"prizeImage": "https://yun.duiba.com/sadawdawd.jpg",
"prizeQuantity": 2,
//"canReceiveTime": thisMoment.clone().startOf('days').add(0, 'days').add(9, 'hours').valueOf(),
"canReceiveTime": thisMoment.clone().add(1, 'minutes').valueOf(),
"expireTime": 1620490140000,
"expireType": 1,
"extraOption": {
"curGear": 1,
"curTargetQuantity": 10,
"curExtraQuantity": 100,
"nextTargetQuantity": 10,
"nextExtraQuantity": 100
}
}
]
}
})
},
"POST /tmrAward_1/receiveIncome.do": {
"code": null,
"data": {
"actualQuantity": 19,
"extraQuantity": null,
"prizeId": "sp_coin",
"prizeImage": "//yun.duiba.com.cn/polaris/奖品图7.26c6302e14a138db5dabfa2c4b6e2d42593a9cfe.png",
"prizeName": "金币",
"prizeQuantity": 19
},
"message": null,
"success": true
},
}
{
"name": "tpl_mvp_jubaopen",
"version": "2.0.38",
"private": true,
"scripts": {
"dev": "npm run assets && cross-env PAGE=index node ./config/webpack.dev.config.js 8089",
"dev:share": "npm run assets && cross-env PAGE=share node ./config/webpack.dev.config.js",
"prod": "npm version patch --no-git-tag-version && cross-env PAGE=index node ./config/webpack.prod.config.js",
"prod:share": "npm version patch --no-git-tag-version && cross-env PAGE=share node ./config/webpack.prod.config.js",
"build": "npm run assets && npm run imgminup && cross-env npm run prod",
"build:share": "npm run assets && cross-env PAGE=share npm run imgminup && cross-env PAGE=share npm run prod:share",
"assets": "node ./config/scripts/assets/generateAssetList.js",
"imgmin": "node ./config/scripts/assets/index.js imgmin",
"imgup": "node ./config/scripts/assets/index.js imgup",
"imgminup": "node ./config/scripts/assets/index.js imgmin imgup",
"px": "spark px publish",
"px:share": "spark px publish -c px.share.config.json",
"pub:index": "yarn prod && yarn px -e dev && yarn px -e test && yarn px -e prod-test",
"pub:share": "yarn prod:share && yarn px:share -e test && yarn px:share -e prod-test"
},
"dependencies": {
"@spark/api-base": "^2.0.35",
"@spark/api-bindPhone": "^1.0.46",
"@spark/api-carousel": "^1.0.9",
"@spark/api-newGuide": "^1.0.25",
"@spark/api-task": "^1.0.37",
"@spark/common-helpers": "^1.0.22",
"@spark/dbdomain": "^1.0.25",
"@spark/preset-checkin": "^1.0.46",
"@spark/preset-exchange": "^1.0.10",
"@spark/preset-task": "^1.0.20",
"@spark/projectx": "^2.0.5",
"@spark/share": "^2.0.200",
"@spark/svgaplayer": "^2.0.4",
"@spark/ui": "^2.1.2",
"@spark/canvas-widget": "^1.0.2",
"@spark/utils": "^2.0.81",
"@types/swiper": "^5.4.3",
"css-loader": "^3.6.0",
"dayjs": "^1.10.8",
"duiba-utils": "^1.0.12",
"history": "^4.10.1",
"mobx": "^6.2.0",
"mobx-react": "^7.1.0",
"postcss-loader": "^3.0.0",
"prettier": "^2.0.5",
"qs": "^6.9.4",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-router-dom": "^5.2.0",
"spark-wrapper-fyge": "^1.1.21",
"style-loader": "^1.2.1",
"swiper": "^6.8.3"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/plugin-proposal-decorators": "^7.13.15",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@types/react": "^17.0.43",
"autoprefixer": "^9.8.6",
"babel-loader": "^8.2.2",
"chalk": "^4.1.0",
"clean-webpack-plugin": "^3.0.0",
"cross-env": "^7.0.3",
"eslint-loader": "^4.0.2",
"fs-extra": "^9.0.1",
"html-webpack-plugin": "^4.5.1",
"less": "^4.1.0",
"less-loader": "^7.2.1",
"mini-css-extract-plugin": "^1.3.4",
"mocker-api": "^2.7.5",
"mockjs": "^1.1.0",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"postcss-px2rem-exclude": "0.0.6",
"progress-bar-webpack-plugin": "^2.1.0",
"script-ext-html-webpack-plugin": "^2.1.5",
"spark-assets": "^1.1.6",
"spark-log-event": "^1.0.4",
"url-loader": "^4.1.1",
"webpack": "^4.43.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2"
}
}
{"proSetting":{"projectxIDs":{"devId":"p6e78cb4b","testId":"pedd5a881","prodId":"p65d1852e"},"skinVariables":[]},"envSetting":{}}
{
"skinFile": "dist/index/index.html",
"skinName": "首页",
"envs": {
"dev": {
"projectId-v1": "p84b9dbeb",
"projectId": "p5a734588",
"skinId": "index",
"skinType": "1"
},
"test": {
"projectId-v1": "p5e04e51c",
"projectId": "p50c46581",
"skinId": "index",
"skinType": "1"
},
"prod-test": {
"projectId-v1": "pc4d80344",
"projectId": "pa6afa0be",
"skinId": "index",
"skinType": "1"
}
}
}
{
"skinFile": "dist/share/index.html",
"skinName": "分享页",
"envs": {
"dev": {
"projectId-v1": "p84b9dbeb",
"projectId": "p5a734588",
"skinId": "share",
"skinType": "2"
},
"test": {
"projectId-v1": "p5e04e51c",
"projectId": "p50c46581",
"skinId": "share",
"skinType": "2"
},
"prod-test": {
"projectId-v1": "pc4d80344",
"projectId": "pa6afa0be",
"skinId": "share",
"skinType": "2"
}
}
}
const page = process.env.PAGE || 'index'
console.log('Current page:', page)
module.exports = {
"OUTPUT_DIR": `dist/${page}`,
"SOURCE_DIR": "src",
"TEMP_DIR": "./.temp",
"ENTRY": `src/${page}.jsx`,
"TEMPLATE": `./public/${page}.html`,
"API_MOCK": true,
"PX2REM": true,
"IMAGE_Q1": 0.6,
"IMAGE_Q2": 0.8,
"UNMINIFY_INDEX": true,
"RES_PATH": "/src/assets/",
"RES_PATH_PROD": "//yun.duiba.com.cn/spark/v2/tpl_mvp_jubaopen/1656323829685",
"JS_PATH_PROD": "https://yun.duiba.com.cn/spark/v2/tpl_mvp_jubaopen/1656324036616/js"
}
This diff is collapsed.
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true
},
"include": [
"src"
],
"exclude": [
"node_modules"
]
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment