代码拉取完成,页面将自动刷新
同步操作将从 Tonvey/free-tex-packer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const argv = require('optimist').argv;
let entry = [
'babel-polyfill',
'./src/client/index'
];
let plugins = [];
let devtool = 'eval-source-map';
let output = 'static/js/index.js';
let debug = true;
let PLATFORM = argv.platform || 'web';
let NODE_ENV = argv.build ? 'production' : 'development';
let target = 'web';
if (PLATFORM === 'electron') target = 'electron-renderer';
plugins.push(new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
'PLATFORM': JSON.stringify(PLATFORM)
}));
if (argv.build) {
let outputDir;
if (PLATFORM === 'web') {
outputDir = 'web/';
}
if (PLATFORM === 'electron') {
outputDir = '../electron/www/';
}
plugins.push(new CopyWebpackPlugin([{from: 'src/client/resources', to: outputDir}]));
devtool = false;
output = outputDir + 'static/js/index.js';
debug = false;
}
else {
entry.push('webpack-dev-server/client?http://localhost:4000');
plugins.push(new CopyWebpackPlugin([{from: 'src/client/resources', to: './'}]));
}
let config = {
entry: entry,
output: {
path: __dirname + "/dist",
filename: output
},
devtool: devtool,
target: target,
mode: NODE_ENV,
module: {
noParse: /.*[\/\\]bin[\/\\].+\.js/,
rules: [
{
test: /.jsx?$/,
include: [path.resolve(__dirname, 'src')],
use: [{loader: 'babel-loader', options: {presets: ['@babel/preset-react', '@babel/preset-env']}}]
},
{
test: /\.js$/,
include: [path.resolve(__dirname, 'src')],
use: [{loader: 'babel-loader', options: {presets: ['@babel/preset-env']}}]
},
{
test: /\.(html|htm)$/,
use: [{loader: 'dom'}]
}
]
},
optimization: {
minimize: false
},
plugins: plugins
};
if (target === 'electron-renderer') {
config.resolve = {alias: {'platform': path.resolve(__dirname, './src/client/platform/electron')}};
} else {
config.resolve = {alias: {'platform': path.resolve(__dirname, './src/client/platform/web')}};
}
module.exports = config;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。