代码拉取完成,页面将自动刷新
同步操作将从 88250/solo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Symphony - A modern community (forum/BBS/SNS/blog) platform written in Java.
* Copyright (C) 2012-present, b3log.org
*
* 本文件属于 Sym 商业版的一部分,请仔细阅读项目根文件夹的 LICENSE 并严格遵守相关约定
*/
/**
* @fileoverview webpack ipfs.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 0.1.0.0, Jan 18, 2020
*/
const path = require('path')
const fs = require('fs')
const TerserPlugin = require('terser-webpack-plugin')
const {CleanWebpackPlugin} = require('clean-webpack-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const genSkinsEntries = () => {
const entries = {}
fs.readdirSync('./src/main/resources/skins').forEach(function (file) {
const jsPath = `./src/main/resources/skins/${file}`
try {
fs.statSync(`${jsPath}/js/common.js`)
entries[`skins/${file}/js/common`] = `${jsPath}/js/common.js`
} catch (e) {
}
try {
fs.statSync(`${jsPath}/css/base.scss`)
entries[`dist/${file}/base`] = `${jsPath}/css/base.scss`
} catch (e) {
}
})
return entries
}
module.exports = (env, argv) => {
return {
mode: argv.mode || 'development',
watch: argv.mode !== 'production',
stats: 'minimal',
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, './src/main/resources'),
},
entry: Object.assign(genSkinsEntries(), {
'js/admin/admin': [
'./src/main/resources/js/admin/admin.js',
'./src/main/resources/js/admin/editor.js',
'./src/main/resources/js/admin/tablePaginate.js',
'./src/main/resources/js/admin/article.js',
'./src/main/resources/js/admin/comment.js',
'./src/main/resources/js/admin/articleList.js',
'./src/main/resources/js/admin/draftList.js',
'./src/main/resources/js/admin/pageList.js',
'./src/main/resources/js/admin/others.js',
'./src/main/resources/js/admin/linkList.js',
'./src/main/resources/js/admin/preference.js',
'./src/main/resources/js/admin/staticsite.js',
'./src/main/resources/js/admin/themeList.js',
'./src/main/resources/js/admin/pluginList.js',
'./src/main/resources/js/admin/userList.js',
'./src/main/resources/js/admin/categoryList.js',
'./src/main/resources/js/admin/commentList.js',
'./src/main/resources/js/admin/plugin.js',
'./src/main/resources/js/admin/main.js',
'./src/main/resources/js/admin/about.js'],
'js/common': './src/main/resources/js/common.js',
'js/page': './src/main/resources/js/page.js',
'dist/admin': './src/main/resources/scss/admin.scss',
'dist/base': './src/main/resources/scss/base.scss',
'dist/start': './src/main/resources/scss/start.scss',
}),
module: {
rules: [
{
test: /\.js/,
include: [
path.resolve(__dirname, './src/main/resources/js'),
path.resolve(__dirname, './src/main/resources/templates/skins'),
],
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{
test: /\.scss$/,
include: [
path.resolve(__dirname, './src/main/resources'),
],
use: [
{
loader: 'file-loader',
options: {
name (file) {
const skins = file.split('skins')
if (skins.length === 2) {
return `skins/${skins[1].split(path.sep)[1]}/css/[name].css`
} else {
return 'scss/[name].css'
}
},
},
},
{
loader: 'extract-loader',
options: {
url: false,
},
},
{
loader: 'css-loader', // translates CSS into CommonJS
options: {
url: false,
},
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [
require('autoprefixer')({grid: true, remove: false}),
],
},
},
{
loader: 'sass-loader', // compiles Sass to CSS
},
],
},
],
},
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
output: {
comments: false,
},
},
sourceMap: false,
extractComments: false,
}),
new OptimizeCSSAssetsPlugin({}),
],
},
plugins: [
new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: [
path.join(__dirname, 'src/main/resources/dist')],
}),
],
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。