fix-3325
into V20230425
@@ -82,7 +82,8 @@ coverage.all | |||||
/public/css | /public/css | ||||
/public/fonts | /public/fonts | ||||
/public/fomantic | /public/fomantic | ||||
/public/img/svg | |||||
/public/img/webpack | |||||
/VERSION | /VERSION | ||||
@@ -90,7 +90,7 @@ WEBPACK_CONFIGS := webpack.config.js | |||||
WEBPACK_CONFIGS_TMP := webpack_temp.config.js | WEBPACK_CONFIGS_TMP := webpack_temp.config.js | ||||
WEBPACK_CONFIGS_PRO := webpack_pro.config.js | WEBPACK_CONFIGS_PRO := webpack_pro.config.js | ||||
WEBPACK_DEST := public/js/index.js public/css/index.css | WEBPACK_DEST := public/js/index.js public/css/index.css | ||||
WEBPACK_DEST_DIRS := public/js public/css public/fonts | |||||
WEBPACK_DEST_DIRS := public/js public/css public/fonts public/img/webpack | |||||
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go | BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go | ||||
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST)) | BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST)) | ||||
@@ -297,7 +297,7 @@ lint-frontend: node_modules | |||||
.PHONY: watch-frontend | .PHONY: watch-frontend | ||||
watch-frontend: node_modules | watch-frontend: node_modules | ||||
NODE_ENV=development npx webpack --hide-modules --display-entrypoints=false --watch --progress | |||||
NODE_ENV=development npx webpack --watch --progress | |||||
.PHONY: test | .PHONY: test | ||||
test: | test: | ||||
@@ -576,7 +576,7 @@ release-sources: | $(DIST_DIRS) node_modules | |||||
rm -f $(STORED_VERSION_FILE) | rm -f $(STORED_VERSION_FILE) | ||||
node_modules: package-lock.json | node_modules: package-lock.json | ||||
npm install --no-save | |||||
npm install --no-save --legacy-peer-deps | |||||
@touch node_modules | @touch node_modules | ||||
.PHONY: npm-update | .PHONY: npm-update | ||||
@@ -614,7 +614,7 @@ webpack_end: | |||||
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json | node_modules | $(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json | node_modules | ||||
rm -rf $(WEBPACK_DEST_DIRS) | rm -rf $(WEBPACK_DEST_DIRS) | ||||
npx webpack --hide-modules --display-entrypoints=false --progress | |||||
npx webpack | |||||
@touch $(WEBPACK_DEST) | @touch $(WEBPACK_DEST) | ||||
.PHONY: update-translations | .PHONY: update-translations | ||||
@@ -1,8 +1,9 @@ | |||||
{ | { | ||||
"license": "MIT", | "license": "MIT", | ||||
"private": true, | "private": true, | ||||
"type": "module", | |||||
"engines": { | "engines": { | ||||
"node": ">= 10.13.0" | |||||
"node": ">= 14.0.0" | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@babel/core": "7.9.6", | "@babel/core": "7.9.6", | ||||
@@ -15,16 +16,17 @@ | |||||
"babel-loader": "8.1.0", | "babel-loader": "8.1.0", | ||||
"clipboard": "2.0.6", | "clipboard": "2.0.6", | ||||
"core-js": "3.6.5", | "core-js": "3.6.5", | ||||
"css-loader": "3.5.3", | |||||
"css-loader": "6.7.3", | |||||
"cssnano": "4.1.10", | "cssnano": "4.1.10", | ||||
"dayjs": "1.10.7", | "dayjs": "1.10.7", | ||||
"domino": "2.1.5", | "domino": "2.1.5", | ||||
"dropzone": "5.7.2", | "dropzone": "5.7.2", | ||||
"echarts": "3.8.5", | "echarts": "3.8.5", | ||||
"element-ui": "2.15.5", | "element-ui": "2.15.5", | ||||
"esbuild-loader": "2.21.0", | |||||
"esdk-obs-browserjs": "3.22.3", | "esdk-obs-browserjs": "3.22.3", | ||||
"esdk-obs-nodejs": "3.20.11", | "esdk-obs-nodejs": "3.20.11", | ||||
"fast-glob": "3.2.2", | |||||
"fast-glob": "3.2.12", | |||||
"file-loader": "6.0.0", | "file-loader": "6.0.0", | ||||
"file-saver": "2.0.5", | "file-saver": "2.0.5", | ||||
"fomantic-ui": "2.8.4", | "fomantic-ui": "2.8.4", | ||||
@@ -35,12 +37,12 @@ | |||||
"jquery-datetimepicker": "2.5.21", | "jquery-datetimepicker": "2.5.21", | ||||
"jquery.are-you-sure": "1.9.0", | "jquery.are-you-sure": "1.9.0", | ||||
"js-cookie": "3.0.1", | "js-cookie": "3.0.1", | ||||
"less-loader": "6.1.0", | |||||
"less-loader": "11.1.0", | |||||
"mini-css-extract-plugin": "2.7.2", | |||||
"markdown-it": "13.0.1", | "markdown-it": "13.0.1", | ||||
"mini-css-extract-plugin": "0.9.0", | |||||
"monaco-editor": "0.20.0", | "monaco-editor": "0.20.0", | ||||
"monaco-editor-webpack-plugin": "1.9.0", | "monaco-editor-webpack-plugin": "1.9.0", | ||||
"optimize-css-assets-webpack-plugin": "5.0.3", | |||||
"npm": "9.5.0", | |||||
"postcss-loader": "3.0.0", | "postcss-loader": "3.0.0", | ||||
"postcss-preset-env": "6.7.0", | "postcss-preset-env": "6.7.0", | ||||
"postcss-safe-parser": "4.0.2", | "postcss-safe-parser": "4.0.2", | ||||
@@ -48,7 +50,7 @@ | |||||
"qs": "6.9.4", | "qs": "6.9.4", | ||||
"remixicon": "2.5.0", | "remixicon": "2.5.0", | ||||
"spark-md5": "3.0.1", | "spark-md5": "3.0.1", | ||||
"svg-sprite-loader": "5.0.0", | |||||
"svg-sprite-loader": "6.0.11", | |||||
"svgo": "1.3.2", | "svgo": "1.3.2", | ||||
"svgo-loader": "2.2.1", | "svgo-loader": "2.2.1", | ||||
"swagger-ui": "3.25.3", | "swagger-ui": "3.25.3", | ||||
@@ -58,15 +60,15 @@ | |||||
"vue-bar-graph": "1.2.0", | "vue-bar-graph": "1.2.0", | ||||
"vue-calendar-heatmap": "0.8.4", | "vue-calendar-heatmap": "0.8.4", | ||||
"vue-i18n": "6.1.3", | "vue-i18n": "6.1.3", | ||||
"vue-loader": "15.9.2", | |||||
"vue-loader": "15.10.1", | |||||
"vue-router": "3.3.4", | "vue-router": "3.3.4", | ||||
"vue-template-compiler": "2.6.11", | "vue-template-compiler": "2.6.11", | ||||
"vue-tree-list": "1.5.0", | "vue-tree-list": "1.5.0", | ||||
"webpack": "4.43.0", | |||||
"webpack-cli": "3.3.12", | |||||
"webpack": "5.75.0", | |||||
"webpack-cli": "4.10.0", | |||||
"webpack-dev-server": "4.9.3", | "webpack-dev-server": "4.9.3", | ||||
"webpack-fix-style-only-entries": "0.4.0", | "webpack-fix-style-only-entries": "0.4.0", | ||||
"worker-loader": "2.0.0", | |||||
"worker-loader": "3.0.8", | |||||
"xlsx": "0.17.3" | "xlsx": "0.17.3" | ||||
}, | }, | ||||
"devDependencies": { | "devDependencies": { | ||||
@@ -76,10 +78,10 @@ | |||||
"eslint-plugin-vue": "6.2.2", | "eslint-plugin-vue": "6.2.2", | ||||
"prettier": "2.6.2", | "prettier": "2.6.2", | ||||
"script-loader": "0.7.2", | "script-loader": "0.7.2", | ||||
"speed-measure-webpack-plugin": "1.5.0", | |||||
"stylelint": "13.3.3", | "stylelint": "13.3.3", | ||||
"stylelint-config-standard": "20.0.0", | "stylelint-config-standard": "20.0.0", | ||||
"ts-loader": "4.0.0", | "ts-loader": "4.0.0", | ||||
"typescript": "4.5.5", | |||||
"updates": "10.2.11" | "updates": "10.2.11" | ||||
}, | }, | ||||
"scripts": { | "scripts": { | ||||
@@ -51,7 +51,7 @@ | |||||
<script> | <script> | ||||
const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; | const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; | ||||
import LetterAvatar from '../features/letteravatar.js'; | |||||
export default { | export default { | ||||
data() { | data() { | ||||
@@ -93,7 +93,6 @@ created(){ | |||||
this.url = url; | this.url = url; | ||||
let strIndex = this.url.indexOf("contributors") | let strIndex = this.url.indexOf("contributors") | ||||
this.url_code = this.url.substr(0,strIndex) | this.url_code = this.url.substr(0,strIndex) | ||||
this.href_ = window.location.href; | this.href_ = window.location.href; | ||||
let index = this.href_.indexOf("?") | let index = this.href_.indexOf("?") | ||||
this.url_infor = this.href_.substring(index+1,this.href_.length) | this.url_infor = this.href_.substring(index+1,this.href_.length) | ||||
@@ -103,7 +102,7 @@ created(){ | |||||
updated(){ | updated(){ | ||||
if(document.querySelectorAll('img[avatar]').length!==0){ | if(document.querySelectorAll('img[avatar]').length!==0){ | ||||
window.LetterAvatar.transform() | |||||
LetterAvatar.transform() | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
@@ -399,7 +399,7 @@ created(){ | |||||
}; | }; | ||||
</script> | </script> | ||||
<style scoped> | |||||
<style scoped lang="less"> | |||||
.input-search { | .input-search { | ||||
width: 100%; | width: 100%; | ||||
display: -webkit-box; | display: -webkit-box; | ||||
@@ -3,8 +3,9 @@ export default async function highlight(elementOrNodeList) { | |||||
const nodes = 'length' in elementOrNodeList ? elementOrNodeList : [elementOrNodeList]; | const nodes = 'length' in elementOrNodeList ? elementOrNodeList : [elementOrNodeList]; | ||||
if (!nodes.length) return; | if (!nodes.length) return; | ||||
const {default: Worker} = await import(/* webpackChunkName: "highlight" */'./highlight.worker.js'); | |||||
const worker = new Worker(); | |||||
const { default: Worker } = await import(/* webpackChunkName: "highlight" */'./highlight.worker.js'); | |||||
// const worker = new Worker(new URL('./highlight.worker.js', import.meta.url)); | |||||
const worker = new Worker(); | |||||
worker.addEventListener('message', ({data}) => { | worker.addEventListener('message', ({data}) => { | ||||
const {index, html} = data; | const {index, html} = data; | ||||
@@ -1,100 +1,74 @@ | |||||
/** | |||||
* LetterAvatar | |||||
* | |||||
* Artur Heinze | |||||
* Create Letter avatar based on Initials | |||||
* based on https://gist.github.com/leecrossley/6027780 | |||||
*/ | |||||
(function (w, d) { | |||||
function LetterAvatar(name, size, color) { | |||||
name = name || ""; | |||||
size = size || 60; | |||||
var colours = [ | |||||
"#1abc9c", | |||||
"#2ecc71", | |||||
"#3498db", | |||||
"#9b59b6", | |||||
"#34495e", | |||||
"#16a085", | |||||
"#27ae60", | |||||
"#2980b9", | |||||
"#8e44ad", | |||||
"#2c3e50", | |||||
"#f1c40f", | |||||
"#e67e22", | |||||
"#e74c3c", | |||||
"#00bcd4", | |||||
"#95a5a6", | |||||
"#f39c12", | |||||
"#d35400", | |||||
"#c0392b", | |||||
"#bdc3c7", | |||||
"#7f8c8d", | |||||
], | |||||
nameSplit = String(name).split(" "), | |||||
initials, | |||||
charIndex, | |||||
colourIndex, | |||||
canvas, | |||||
context, | |||||
dataURI; | |||||
if (nameSplit.length == 1) { | |||||
initials = nameSplit[0] ? nameSplit[0].charAt(0) : "?"; | |||||
} else { | |||||
initials = nameSplit[0].charAt(0) + nameSplit[1].charAt(0); | |||||
} | |||||
let initials1 = initials.toUpperCase(); | |||||
if (w.devicePixelRatio) { | |||||
size = size * w.devicePixelRatio; | |||||
} | |||||
function LetterAvatar(name, size, color) { | |||||
name = name || ""; | |||||
size = size || 60; | |||||
var colours = [ | |||||
"#1abc9c", | |||||
"#2ecc71", | |||||
"#3498db", | |||||
"#9b59b6", | |||||
"#34495e", | |||||
"#16a085", | |||||
"#27ae60", | |||||
"#2980b9", | |||||
"#8e44ad", | |||||
"#2c3e50", | |||||
"#f1c40f", | |||||
"#e67e22", | |||||
"#e74c3c", | |||||
"#00bcd4", | |||||
"#95a5a6", | |||||
"#f39c12", | |||||
"#d35400", | |||||
"#c0392b", | |||||
"#bdc3c7", | |||||
"#7f8c8d", | |||||
], | |||||
nameSplit = String(name).split(" "), | |||||
initials, | |||||
charIndex, | |||||
colourIndex, | |||||
canvas, | |||||
context, | |||||
dataURI; | |||||
if (nameSplit.length == 1) { | |||||
initials = nameSplit[0] ? nameSplit[0].charAt(0) : "?"; | |||||
} else { | |||||
initials = nameSplit[0].charAt(0) + nameSplit[1].charAt(0); | |||||
} | |||||
let initials1 = initials.toUpperCase(); | |||||
if (window.devicePixelRatio) { | |||||
size = size * window.devicePixelRatio; | |||||
} | |||||
charIndex = (initials == "?" ? 72 : initials.charCodeAt(0)) - 64; | |||||
colourIndex = charIndex % 20; | |||||
canvas = d.createElement("canvas"); | |||||
canvas.width = size; | |||||
canvas.height = size; | |||||
context = canvas.getContext("2d"); | |||||
charIndex = (initials == "?" ? 72 : initials.charCodeAt(0)) - 64; | |||||
colourIndex = charIndex % 20; | |||||
canvas = document.createElement("canvas"); | |||||
canvas.width = size; | |||||
canvas.height = size; | |||||
context = canvas.getContext("2d"); | |||||
context.fillStyle = color ? color : colours[colourIndex - 1]; | |||||
context.fillRect(0, 0, canvas.width, canvas.height); | |||||
context.font = Math.round(canvas.width / 2) + "px 'Microsoft Yahei'"; | |||||
context.textAlign = "center"; | |||||
context.fillStyle = "#FFF"; | |||||
context.fillText(initials1, size / 2, size / 1.5); | |||||
dataURI = canvas.toDataURL(); | |||||
canvas = null; | |||||
return dataURI; | |||||
} | |||||
LetterAvatar.transform = function () { | |||||
Array.prototype.forEach.call( | |||||
d.querySelectorAll("img[avatar]"), | |||||
function (img, name, color) { | |||||
name = img.getAttribute("avatar"); | |||||
color = img.getAttribute("color"); | |||||
img.src = LetterAvatar(name, img.getAttribute("width"), color); | |||||
img.removeAttribute("avatar"); | |||||
img.setAttribute("alt", name); | |||||
} | |||||
); | |||||
}; | |||||
// AMD support | |||||
if (typeof define === "function" && define.amd) { | |||||
define(function () { | |||||
return LetterAvatar; | |||||
}); | |||||
context.fillStyle = color ? color : colours[colourIndex - 1]; | |||||
context.fillRect(0, 0, canvas.width, canvas.height); | |||||
context.font = Math.round(canvas.width / 2) + "px 'Microsoft Yahei'"; | |||||
context.textAlign = "center"; | |||||
context.fillStyle = "#FFF"; | |||||
context.fillText(initials1, size / 2, size / 1.5); | |||||
dataURI = canvas.toDataURL(); | |||||
canvas = null; | |||||
return dataURI; | |||||
} | |||||
// CommonJS and Node.js module support. | |||||
} else if (typeof exports !== "undefined") { | |||||
// Support Node.js specific `module.exports` (which can be a function) | |||||
if (typeof module != "undefined" && module.exports) { | |||||
exports = module.exports = LetterAvatar; | |||||
LetterAvatar.transform = function () { | |||||
Array.prototype.forEach.call( | |||||
document.querySelectorAll("img[avatar]"), | |||||
function (img, name, color) { | |||||
name = img.getAttribute("avatar"); | |||||
color = img.getAttribute("color"); | |||||
img.src = LetterAvatar(name, img.getAttribute("width"), color); | |||||
img.removeAttribute("avatar"); | |||||
img.setAttribute("alt", name); | |||||
} | } | ||||
// But always support CommonJS module 1.1.1 spec (`exports` cannot be a function) | |||||
exports.LetterAvatar = LetterAvatar; | |||||
} else { | |||||
window.LetterAvatar = LetterAvatar; | |||||
d.addEventListener("DOMContentLoaded", function (event) { | |||||
LetterAvatar.transform(); | |||||
}); | |||||
} | |||||
})(window, document); | |||||
); | |||||
}; | |||||
export default LetterAvatar; |
@@ -4,7 +4,6 @@ | |||||
import "./publicpath.js"; | import "./publicpath.js"; | ||||
import "./polyfills.js"; | import "./polyfills.js"; | ||||
import "./features/letteravatar.js"; | |||||
import Vue from "vue"; | import Vue from "vue"; | ||||
import "element-ui/lib/theme-chalk/index.css"; | import "element-ui/lib/theme-chalk/index.css"; | ||||
import localeEn from 'element-ui/lib/locale/lang/en'; | import localeEn from 'element-ui/lib/locale/lang/en'; | ||||
@@ -57,8 +57,8 @@ export default { | |||||
} | } | ||||
</script> | </script> | ||||
<style scoped> | |||||
@import url('../style/index.css'); | |||||
<style scoped lang="less"> | |||||
@import url('../style/index.less'); | |||||
.coll_tag { | .coll_tag { | ||||
margin-top: 25px; | margin-top: 25px; | ||||
@@ -10,22 +10,22 @@ body { | |||||
'Droid Sans', 'Helvetica Neue', 'Microsoft Yahei', sans-serif; | 'Droid Sans', 'Helvetica Neue', 'Microsoft Yahei', sans-serif; | ||||
-webkit-font-smoothing : antialiased; | -webkit-font-smoothing : antialiased; | ||||
-moz-osx-font-smoothing: grayscale; | -moz-osx-font-smoothing: grayscale; | ||||
width : 100%; | |||||
height : 100vh; | |||||
width: 100%; | |||||
height: 100vh; | |||||
} | } | ||||
body * { | body * { | ||||
box-sizing : border-box; | |||||
box-sizing: border-box; | |||||
flex-shrink: 0; | flex-shrink: 0; | ||||
} | } | ||||
.flex-row { | .flex-row { | ||||
display : inline-flex; | |||||
display: inline-flex; | |||||
flex-direction: row; | flex-direction: row; | ||||
} | } | ||||
.flex-col { | .flex-col { | ||||
display : flex; | |||||
display: flex; | |||||
flex-direction: column; | flex-direction: column; | ||||
} | } | ||||
@@ -6,7 +6,7 @@ import localeZh from 'element-ui/lib/locale/lang/zh-CN'; | |||||
import { i18n, lang } from "~/langs"; | import { i18n, lang } from "~/langs"; | ||||
import ElementUI from 'element-ui'; | import ElementUI from 'element-ui'; | ||||
import 'element-ui/lib/theme-chalk/index.css'; | import 'element-ui/lib/theme-chalk/index.css'; | ||||
import './style/index.css' | |||||
import './style/index.less' | |||||
@@ -1,25 +1,24 @@ | |||||
const cssnano = require('cssnano'); | |||||
const fastGlob = require('fast-glob'); | |||||
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries'); | |||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |||||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); | |||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |||||
const PostCSSPresetEnv = require('postcss-preset-env'); | |||||
const PostCSSSafeParser = require('postcss-safe-parser'); | |||||
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); | |||||
const TerserPlugin = require('terser-webpack-plugin'); | |||||
const VueLoaderPlugin = require('vue-loader/lib/plugin'); | |||||
const {statSync} = require('fs'); | |||||
const {resolve, parse} = require('path'); | |||||
const {SourceMapDevToolPlugin} = require('webpack'); | |||||
const glob = (pattern) => fastGlob.sync(pattern, {cwd: __dirname, absolute: true}); | |||||
import fastGlob from 'fast-glob'; | |||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'; | |||||
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin'; | |||||
import {VueLoaderPlugin} from 'vue-loader'; | |||||
import EsBuildLoader from 'esbuild-loader'; | |||||
import {parse, dirname} from 'node:path'; | |||||
import webpack from 'webpack'; | |||||
import {fileURLToPath} from 'node:url'; | |||||
import {readFileSync} from 'node:fs'; | |||||
import TerserPlugin from "terser-webpack-plugin" | |||||
const { ESBuildMinifyPlugin } = EsBuildLoader; | |||||
const { SourceMapDevToolPlugin } = webpack; | |||||
const glob = (pattern) => fastGlob.sync(pattern, { | |||||
cwd: dirname(fileURLToPath(new URL(import.meta.url))), | |||||
absolute: true, | |||||
}); | |||||
const themes = {}; | const themes = {}; | ||||
for (const path of glob('web_src/less/themes/*.less')) { | for (const path of glob('web_src/less/themes/*.less')) { | ||||
themes[parse(path).name] = [path]; | themes[parse(path).name] = [path]; | ||||
} | } | ||||
const standalone = {}; | const standalone = {}; | ||||
const stadalonePaths = [ | const stadalonePaths = [ | ||||
...glob('web_src/js/standalone/**/*.js'), | ...glob('web_src/js/standalone/**/*.js'), | ||||
@@ -28,14 +27,12 @@ const stadalonePaths = [ | |||||
for (const path of stadalonePaths) { | for (const path of stadalonePaths) { | ||||
standalone[parse(path).name] = [path]; | standalone[parse(path).name] = [path]; | ||||
} | } | ||||
const vuePages = {}; | const vuePages = {}; | ||||
for (const path of glob('web_src/vuepages/**/vp-*.js')) { | for (const path of glob('web_src/vuepages/**/vp-*.js')) { | ||||
vuePages[parse(path).name] = [path]; | vuePages[parse(path).name] = [path]; | ||||
} | } | ||||
const isProduction = process.env.NODE_ENV !== 'development'; | const isProduction = process.env.NODE_ENV !== 'development'; | ||||
let isWatching = false; | let isWatching = false; | ||||
for (let arg in process.argv) { | for (let arg in process.argv) { | ||||
if (process.argv[arg] == '--watch') { | if (process.argv[arg] == '--watch') { | ||||
@@ -44,59 +41,45 @@ for (let arg in process.argv) { | |||||
} | } | ||||
} | } | ||||
module.exports = { | |||||
/** @type {import("webpack").Configuration} */ | |||||
export default { | |||||
mode: isProduction ? 'production' : 'development', | mode: isProduction ? 'production' : 'development', | ||||
entry: { | entry: { | ||||
index: [ | index: [ | ||||
resolve(__dirname, 'web_src/js/index.js'), | |||||
resolve(__dirname, 'web_src/less/index.less'), | |||||
fileURLToPath(new URL('web_src/js/index.js', import.meta.url)), | |||||
fileURLToPath(new URL('web_src/less/index.less', import.meta.url)), | |||||
], | ], | ||||
jquery: [ | jquery: [ | ||||
resolve(__dirname, 'web_src/js/jquery.js'), | |||||
fileURLToPath(new URL('web_src/js/jquery.js', import.meta.url)), | |||||
], | ], | ||||
icons: glob('node_modules/@primer/octicons/build/svg/**/*.svg'), | icons: glob('node_modules/@primer/octicons/build/svg/**/*.svg'), | ||||
...standalone, | ...standalone, | ||||
...themes, | ...themes, | ||||
...vuePages, | |||||
...vuePages | |||||
}, | }, | ||||
devtool: false, | devtool: false, | ||||
output: { | output: { | ||||
path: resolve(__dirname, 'public'), | |||||
filename: 'js/[name].js', | |||||
path: fileURLToPath(new URL('public', import.meta.url)), | |||||
filename: ({ chunk }) => { | |||||
// serviceworker can only manage assets below it's script's directory so | |||||
// we have to put it in / instead of /js/ | |||||
return chunk.name === 'serviceworker' ? '[name].js' : 'js/[name].js'; | |||||
}, | |||||
chunkFilename: 'js/[name].js', | chunkFilename: 'js/[name].js', | ||||
}, | }, | ||||
node:{ | |||||
fs: 'empty' | |||||
}, | |||||
optimization: { | optimization: { | ||||
minimize: false, | |||||
minimize: true, | |||||
minimizer: [ | minimizer: [ | ||||
new TerserPlugin({ | |||||
sourceMap: true, | |||||
extractComments: false, | |||||
terserOptions: { | |||||
keep_fnames: /^(HTML|SVG)/, // https://github.com/fgnass/domino/issues/144 | |||||
output: { | |||||
comments: false, | |||||
}, | |||||
}, | |||||
}), | |||||
new OptimizeCSSAssetsPlugin({ | |||||
cssProcessor: cssnano, | |||||
cssProcessorOptions: { | |||||
parser: PostCSSSafeParser, | |||||
}, | |||||
cssProcessorPluginOptions: { | |||||
preset: [ | |||||
'default', | |||||
{ | |||||
discardComments: { | |||||
removeAll: true, | |||||
}, | |||||
}, | |||||
], | |||||
}, | |||||
new ESBuildMinifyPlugin({ | |||||
target: 'es2015', | |||||
minify: true, | |||||
css: true, | |||||
legalComments: 'none', | |||||
}), | }), | ||||
// new TerserPlugin({ | |||||
// extractComments: false, | |||||
// }), | |||||
], | ], | ||||
splitChunks: { | splitChunks: { | ||||
chunks: 'async', | chunks: 'async', | ||||
@@ -109,7 +92,9 @@ module.exports = { | |||||
chunks: 'async' | chunks: 'async' | ||||
} | } | ||||
} | } | ||||
} | |||||
}, | |||||
moduleIds: 'named', | |||||
chunkIds: 'named', | |||||
}, | }, | ||||
module: { | module: { | ||||
rules: [ | rules: [ | ||||
@@ -118,10 +103,6 @@ module.exports = { | |||||
exclude: /node_modules/, | exclude: /node_modules/, | ||||
loader: 'vue-loader', | loader: 'vue-loader', | ||||
}, | }, | ||||
{ | |||||
test: require.resolve('jquery-datetimepicker'), | |||||
use: 'imports-loader?define=>false,exports=>false', | |||||
}, | |||||
{ | { | ||||
test: /\.worker\.js$/, | test: /\.worker\.js$/, | ||||
exclude: /monaco/, | exclude: /monaco/, | ||||
@@ -129,61 +110,32 @@ module.exports = { | |||||
{ | { | ||||
loader: 'worker-loader', | loader: 'worker-loader', | ||||
options: { | options: { | ||||
name: '[name].js', | |||||
inline: true, | |||||
fallback: false, | |||||
inline: 'no-fallback', | |||||
}, | }, | ||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | { | ||||
test: /\.ts$/, | |||||
use: [ | |||||
{ | |||||
loader: "ts-loader", | |||||
} | |||||
], | |||||
exclude: /node_modules/ | |||||
test: /\.m?js/, | |||||
type: "javascript/auto", | |||||
resolve: { | |||||
fullySpecified:false | |||||
} | |||||
}, | }, | ||||
{ | { | ||||
test: /\.js$/, | test: /\.js$/, | ||||
exclude: /node_modules/, | exclude: /node_modules/, | ||||
use: [ | use: [ | ||||
{ | { | ||||
loader: 'babel-loader', | |||||
loader: 'esbuild-loader', | |||||
options: { | options: { | ||||
cacheDirectory: true, | |||||
cacheCompression: false, | |||||
cacheIdentifier: [ | |||||
resolve(__dirname, 'package.json'), | |||||
resolve(__dirname, 'package-lock.json'), | |||||
resolve(__dirname, 'webpack.config.js'), | |||||
].map((path) => statSync(path).mtime.getTime()).join(':'), | |||||
sourceMaps: true, | |||||
presets: [ | |||||
[ | |||||
'@babel/preset-env', | |||||
{ | |||||
useBuiltIns: 'usage', | |||||
corejs: 3, | |||||
}, | |||||
], | |||||
], | |||||
plugins: [ | |||||
[ | |||||
'@babel/plugin-transform-runtime', | |||||
{ | |||||
regenerator: true, | |||||
} | |||||
], | |||||
'@babel/plugin-proposal-object-rest-spread', | |||||
], | |||||
target: 'es2015' | |||||
}, | }, | ||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | { | ||||
test: /\.(less|css)$/i, | |||||
test: /.css$/i, | |||||
use: [ | use: [ | ||||
{ | { | ||||
loader: MiniCssExtractPlugin.loader, | loader: MiniCssExtractPlugin.loader, | ||||
@@ -192,32 +144,70 @@ module.exports = { | |||||
loader: 'css-loader', | loader: 'css-loader', | ||||
options: { | options: { | ||||
importLoaders: 2, | importLoaders: 2, | ||||
url: (_url, resourcePath) => { | |||||
// only resolve URLs for dependencies | |||||
url: { | |||||
filter: (url, resourcePath) => { | |||||
// only resolve URLs for dependencies | |||||
return resourcePath.includes('node_modules'); | return resourcePath.includes('node_modules'); | ||||
}, | |||||
}, | |||||
} | |||||
} | } | ||||
}, | }, | ||||
], | |||||
}, | |||||
{ | |||||
test: /.less$/i, | |||||
use: [ | |||||
{ | { | ||||
loader: 'postcss-loader', | |||||
loader: MiniCssExtractPlugin.loader, | |||||
}, | |||||
{ | |||||
loader: 'css-loader', | |||||
options: { | options: { | ||||
plugins: () => [ | |||||
PostCSSPresetEnv(), | |||||
], | |||||
sourceMap: true, | |||||
importLoaders: 2, | |||||
url: { | |||||
filter: (url, resourcePath) => { | |||||
// only resolve URLs for dependencies | |||||
return resourcePath.includes('node_modules'); | |||||
}, | |||||
} | |||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
loader: 'less-loader', | loader: 'less-loader', | ||||
options: { | |||||
sourceMap: true, | |||||
}, | |||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | |||||
test: /\.(ttf|woff2?)$/, | |||||
type: 'asset/resource', | |||||
generator: { | |||||
filename: 'fonts/[name].[ext]', | |||||
} | |||||
}, | |||||
{ | |||||
test: /\.(png|jpg|gif)$/, | |||||
type: 'asset/resource', | |||||
generator: { | |||||
filename: 'img/webpack/[name].[ext]', | |||||
} | |||||
}, | |||||
{ | |||||
test: /\.json$/, | |||||
type: 'json', | |||||
}, | |||||
{ | { | ||||
test: /\.svg$/, | test: /\.svg$/, | ||||
use: [ | use: [ | ||||
{ | { | ||||
loader: 'svg-sprite-loader', | loader: 'svg-sprite-loader', | ||||
options: { | options: { | ||||
extract: true, | |||||
// extract: true, | |||||
spriteFilename: 'img/svg/icons.svg', | spriteFilename: 'img/svg/icons.svg', | ||||
symbolId: (path) => { | symbolId: (path) => { | ||||
const {name} = parse(path); | const {name} = parse(path); | ||||
@@ -233,36 +223,10 @@ module.exports = { | |||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | |||||
test: /\.(png|jpg|gif)$/, | |||||
use: [ | |||||
{ | |||||
loader: 'file-loader' | |||||
}, | |||||
], | |||||
}, | |||||
{ | |||||
test: /\.(ttf|woff2?)$/, | |||||
use: [ | |||||
{ | |||||
loader: 'file-loader', | |||||
options: { | |||||
name: '[name].[ext]', | |||||
outputPath: 'fonts/', | |||||
publicPath: (url) => `../fonts/${url}`, // seems required for monaco's font | |||||
}, | |||||
}, | |||||
], | |||||
}, | |||||
], | ], | ||||
}, | }, | ||||
plugins: [ | plugins: [ | ||||
new VueLoaderPlugin(), | new VueLoaderPlugin(), | ||||
// avoid generating useless js output files for css- and svg-only chunks | |||||
new FixStyleOnlyEntriesPlugin({ | |||||
extensions: ['less', 'scss', 'css', 'svg'], | |||||
silent: true, | |||||
}), | |||||
new MiniCssExtractPlugin({ | new MiniCssExtractPlugin({ | ||||
filename: 'css/[name].css', | filename: 'css/[name].css', | ||||
chunkFilename: 'css/[name].css', | chunkFilename: 'css/[name].css', | ||||
@@ -273,14 +237,13 @@ module.exports = { | |||||
'js/index.js', | 'js/index.js', | ||||
/js\/vp-.*\.js/, | /js\/vp-.*\.js/, | ||||
], | ], | ||||
})] : []) | |||||
, | |||||
new SpriteLoaderPlugin({ | |||||
plainSprite: true, | |||||
}), | |||||
})] : []), | |||||
new MonacoWebpackPlugin({ | new MonacoWebpackPlugin({ | ||||
filename: 'js/monaco-[name].worker.js', | filename: 'js/monaco-[name].worker.js', | ||||
}) | |||||
}), | |||||
new webpack.ProvidePlugin({ | |||||
Buffer: ['buffer', 'Buffer'] | |||||
}), | |||||
], | ], | ||||
performance: { | performance: { | ||||
hints: false, | hints: false, | ||||
@@ -291,9 +254,9 @@ module.exports = { | |||||
symlinks: false, | symlinks: false, | ||||
alias: { | alias: { | ||||
vue$: 'vue/dist/vue.esm.js', // needed because vue's default export is the runtime only | vue$: 'vue/dist/vue.esm.js', // needed because vue's default export is the runtime only | ||||
'~': resolve(__dirname, 'web_src/vuepages'), | |||||
'~': fileURLToPath(new URL('web_src/vuepages', import.meta.url)) | |||||
}, | }, | ||||
extensions: ['.tsx', '.ts', '.js'] | |||||
extensions: ['.vue', '.ts', '.js'] | |||||
}, | }, | ||||
watchOptions: { | watchOptions: { | ||||
ignored: [ | ignored: [ | ||||
@@ -301,6 +264,23 @@ module.exports = { | |||||
], | ], | ||||
}, | }, | ||||
stats: { | stats: { | ||||
assetsSort: 'name', | |||||
assetsSpace: Infinity, | |||||
cached: false, | |||||
cachedModules: false, | |||||
children: false, | children: false, | ||||
chunkModules: false, | |||||
chunkOrigins: false, | |||||
chunksSort: 'name', | |||||
colors: true, | |||||
entrypoints: false, | |||||
groupAssetsByChunk: false, | |||||
groupAssetsByEmitStatus: false, | |||||
groupAssetsByInfo: false, | |||||
groupModulesByAttributes: false, | |||||
modules: false, | |||||
reasons: false, | |||||
runtimeModules: false, | |||||
}, | }, | ||||
}; | }; |
@@ -1,25 +1,24 @@ | |||||
const cssnano = require('cssnano'); | |||||
const fastGlob = require('fast-glob'); | |||||
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries'); | |||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |||||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); | |||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |||||
const PostCSSPresetEnv = require('postcss-preset-env'); | |||||
const PostCSSSafeParser = require('postcss-safe-parser'); | |||||
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); | |||||
const TerserPlugin = require('terser-webpack-plugin'); | |||||
const VueLoaderPlugin = require('vue-loader/lib/plugin'); | |||||
const {statSync} = require('fs'); | |||||
const {resolve, parse} = require('path'); | |||||
//const {SourceMapDevToolPlugin} = require('webpack'); | |||||
const glob = (pattern) => fastGlob.sync(pattern, {cwd: __dirname, absolute: true}); | |||||
import fastGlob from 'fast-glob'; | |||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'; | |||||
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin'; | |||||
import {VueLoaderPlugin} from 'vue-loader'; | |||||
import EsBuildLoader from 'esbuild-loader'; | |||||
import {parse, dirname} from 'node:path'; | |||||
import webpack from 'webpack'; | |||||
import {fileURLToPath} from 'node:url'; | |||||
import {readFileSync} from 'node:fs'; | |||||
import TerserPlugin from "terser-webpack-plugin" | |||||
const { ESBuildMinifyPlugin } = EsBuildLoader; | |||||
const { SourceMapDevToolPlugin } = webpack; | |||||
const glob = (pattern) => fastGlob.sync(pattern, { | |||||
cwd: dirname(fileURLToPath(new URL(import.meta.url))), | |||||
absolute: true, | |||||
}); | |||||
const themes = {}; | const themes = {}; | ||||
for (const path of glob('web_src/less/themes/*.less')) { | for (const path of glob('web_src/less/themes/*.less')) { | ||||
themes[parse(path).name] = [path]; | themes[parse(path).name] = [path]; | ||||
} | } | ||||
const standalone = {}; | const standalone = {}; | ||||
const stadalonePaths = [ | const stadalonePaths = [ | ||||
...glob('web_src/js/standalone/**/*.js'), | ...glob('web_src/js/standalone/**/*.js'), | ||||
@@ -28,7 +27,6 @@ const stadalonePaths = [ | |||||
for (const path of stadalonePaths) { | for (const path of stadalonePaths) { | ||||
standalone[parse(path).name] = [path]; | standalone[parse(path).name] = [path]; | ||||
} | } | ||||
const vuePages = {}; | const vuePages = {}; | ||||
for (const path of glob('web_src/vuepages/**/vp-*.js')) { | for (const path of glob('web_src/vuepages/**/vp-*.js')) { | ||||
vuePages[parse(path).name] = [path]; | vuePages[parse(path).name] = [path]; | ||||
@@ -36,58 +34,42 @@ for (const path of glob('web_src/vuepages/**/vp-*.js')) { | |||||
const isProduction = process.env.NODE_ENV !== 'development'; | const isProduction = process.env.NODE_ENV !== 'development'; | ||||
module.exports = { | |||||
/** @type {import("webpack").Configuration} */ | |||||
export default { | |||||
mode: isProduction ? 'production' : 'development', | mode: isProduction ? 'production' : 'development', | ||||
entry: { | entry: { | ||||
index: [ | index: [ | ||||
resolve(__dirname, 'web_src/js/index.js'), | |||||
resolve(__dirname, 'web_src/less/index.less'), | |||||
fileURLToPath(new URL('web_src/js/index.js', import.meta.url)), | |||||
fileURLToPath(new URL('web_src/less/index.less', import.meta.url)), | |||||
], | ], | ||||
jquery: [ | jquery: [ | ||||
resolve(__dirname, 'web_src/js/jquery.js'), | |||||
fileURLToPath(new URL('web_src/js/jquery.js', import.meta.url)), | |||||
], | ], | ||||
icons: glob('node_modules/@primer/octicons/build/svg/**/*.svg'), | icons: glob('node_modules/@primer/octicons/build/svg/**/*.svg'), | ||||
...standalone, | ...standalone, | ||||
...themes, | ...themes, | ||||
...vuePages | ...vuePages | ||||
}, | }, | ||||
devtool: false, | devtool: false, | ||||
output: { | output: { | ||||
path: resolve(__dirname, 'public'), | |||||
filename: 'js/[name].js', | |||||
path: fileURLToPath(new URL('public', import.meta.url)), | |||||
filename: ({ chunk }) => { | |||||
// serviceworker can only manage assets below it's script's directory so | |||||
// we have to put it in / instead of /js/ | |||||
return chunk.name === 'serviceworker' ? '[name].js' : 'js/[name].js'; | |||||
}, | |||||
chunkFilename: 'js/[name].js', | chunkFilename: 'js/[name].js', | ||||
}, | }, | ||||
node:{ | |||||
fs: 'empty' | |||||
}, | |||||
optimization: { | optimization: { | ||||
minimize: true, | minimize: true, | ||||
minimizer: [ | minimizer: [ | ||||
new TerserPlugin({ | |||||
sourceMap: false, | |||||
extractComments: false, | |||||
terserOptions: { | |||||
keep_fnames: /^(HTML|SVG)/, // https://github.com/fgnass/domino/issues/144 | |||||
output: { | |||||
comments: false, | |||||
}, | |||||
}, | |||||
}), | |||||
new OptimizeCSSAssetsPlugin({ | |||||
cssProcessor: cssnano, | |||||
cssProcessorOptions: { | |||||
parser: PostCSSSafeParser, | |||||
}, | |||||
cssProcessorPluginOptions: { | |||||
preset: [ | |||||
'default', | |||||
{ | |||||
discardComments: { | |||||
removeAll: true, | |||||
}, | |||||
}, | |||||
], | |||||
}, | |||||
new ESBuildMinifyPlugin({ | |||||
target: 'es2015', | |||||
minify: true, | |||||
css: true, | |||||
legalComments: 'none', | |||||
}), | }), | ||||
], | ], | ||||
splitChunks: { | splitChunks: { | ||||
@@ -101,7 +83,9 @@ module.exports = { | |||||
chunks: 'async' | chunks: 'async' | ||||
} | } | ||||
} | } | ||||
} | |||||
}, | |||||
moduleIds: 'named', | |||||
chunkIds: 'named', | |||||
}, | }, | ||||
module: { | module: { | ||||
rules: [ | rules: [ | ||||
@@ -110,10 +94,6 @@ module.exports = { | |||||
exclude: /node_modules/, | exclude: /node_modules/, | ||||
loader: 'vue-loader', | loader: 'vue-loader', | ||||
}, | }, | ||||
{ | |||||
test: require.resolve('jquery-datetimepicker'), | |||||
use: 'imports-loader?define=>false,exports=>false', | |||||
}, | |||||
{ | { | ||||
test: /\.worker\.js$/, | test: /\.worker\.js$/, | ||||
exclude: /monaco/, | exclude: /monaco/, | ||||
@@ -121,61 +101,32 @@ module.exports = { | |||||
{ | { | ||||
loader: 'worker-loader', | loader: 'worker-loader', | ||||
options: { | options: { | ||||
name: '[name].js', | |||||
inline: true, | |||||
fallback: false, | |||||
inline: 'no-fallback', | |||||
}, | }, | ||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | { | ||||
test: /\.ts$/, | |||||
use: [ | |||||
{ | |||||
loader: "ts-loader", | |||||
} | |||||
], | |||||
exclude: /node_modules/ | |||||
test: /\.m?js/, | |||||
type: "javascript/auto", | |||||
resolve: { | |||||
fullySpecified:false | |||||
} | |||||
}, | }, | ||||
{ | { | ||||
test: /\.js$/, | test: /\.js$/, | ||||
exclude: /node_modules/, | exclude: /node_modules/, | ||||
use: [ | use: [ | ||||
{ | { | ||||
loader: 'babel-loader', | |||||
loader: 'esbuild-loader', | |||||
options: { | options: { | ||||
cacheDirectory: true, | |||||
cacheCompression: false, | |||||
cacheIdentifier: [ | |||||
resolve(__dirname, 'package.json'), | |||||
resolve(__dirname, 'package-lock.json'), | |||||
resolve(__dirname, 'webpack.config.js'), | |||||
].map((path) => statSync(path).mtime.getTime()).join(':'), | |||||
sourceMaps: true, | |||||
presets: [ | |||||
[ | |||||
'@babel/preset-env', | |||||
{ | |||||
useBuiltIns: 'usage', | |||||
corejs: 3, | |||||
}, | |||||
], | |||||
], | |||||
plugins: [ | |||||
[ | |||||
'@babel/plugin-transform-runtime', | |||||
{ | |||||
regenerator: true, | |||||
} | |||||
], | |||||
'@babel/plugin-proposal-object-rest-spread', | |||||
], | |||||
target: 'es2015' | |||||
}, | }, | ||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | { | ||||
test: /\.(less|css)$/i, | |||||
test: /.css$/i, | |||||
use: [ | use: [ | ||||
{ | { | ||||
loader: MiniCssExtractPlugin.loader, | loader: MiniCssExtractPlugin.loader, | ||||
@@ -184,32 +135,70 @@ module.exports = { | |||||
loader: 'css-loader', | loader: 'css-loader', | ||||
options: { | options: { | ||||
importLoaders: 2, | importLoaders: 2, | ||||
url: (_url, resourcePath) => { | |||||
// only resolve URLs for dependencies | |||||
url: { | |||||
filter: (url, resourcePath) => { | |||||
// only resolve URLs for dependencies | |||||
return resourcePath.includes('node_modules'); | return resourcePath.includes('node_modules'); | ||||
}, | |||||
}, | |||||
} | |||||
} | } | ||||
}, | }, | ||||
], | |||||
}, | |||||
{ | |||||
test: /.less$/i, | |||||
use: [ | |||||
{ | { | ||||
loader: 'postcss-loader', | |||||
loader: MiniCssExtractPlugin.loader, | |||||
}, | |||||
{ | |||||
loader: 'css-loader', | |||||
options: { | options: { | ||||
plugins: () => [ | |||||
PostCSSPresetEnv(), | |||||
], | |||||
sourceMap: true, | |||||
importLoaders: 2, | |||||
url: { | |||||
filter: (url, resourcePath) => { | |||||
// only resolve URLs for dependencies | |||||
return resourcePath.includes('node_modules'); | |||||
}, | |||||
} | |||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
loader: 'less-loader', | loader: 'less-loader', | ||||
options: { | |||||
sourceMap: true, | |||||
}, | |||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | |||||
test: /\.(ttf|woff2?)$/, | |||||
type: 'asset/resource', | |||||
generator: { | |||||
filename: 'fonts/[name].[ext]', | |||||
} | |||||
}, | |||||
{ | |||||
test: /\.(png|jpg|gif)$/, | |||||
type: 'asset/resource', | |||||
generator: { | |||||
filename: 'img/webpack/[name].[ext]', | |||||
} | |||||
}, | |||||
{ | |||||
test: /\.json$/, | |||||
type: 'json', | |||||
}, | |||||
{ | { | ||||
test: /\.svg$/, | test: /\.svg$/, | ||||
use: [ | use: [ | ||||
{ | { | ||||
loader: 'svg-sprite-loader', | loader: 'svg-sprite-loader', | ||||
options: { | options: { | ||||
extract: true, | |||||
// extract: true, | |||||
spriteFilename: 'img/svg/icons.svg', | spriteFilename: 'img/svg/icons.svg', | ||||
symbolId: (path) => { | symbolId: (path) => { | ||||
const {name} = parse(path); | const {name} = parse(path); | ||||
@@ -225,46 +214,20 @@ module.exports = { | |||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | |||||
test: /\.(png|jpg|gif)$/, | |||||
use: [ | |||||
{ | |||||
loader: 'file-loader' | |||||
}, | |||||
], | |||||
}, | |||||
{ | |||||
test: /\.(ttf|woff2?)$/, | |||||
use: [ | |||||
{ | |||||
loader: 'file-loader', | |||||
options: { | |||||
name: '[name].[ext]', | |||||
outputPath: 'fonts/', | |||||
publicPath: (url) => `../fonts/${url}`, // seems required for monaco's font | |||||
}, | |||||
}, | |||||
], | |||||
}, | |||||
], | ], | ||||
}, | }, | ||||
plugins: [ | plugins: [ | ||||
new VueLoaderPlugin(), | new VueLoaderPlugin(), | ||||
// avoid generating useless js output files for css- and svg-only chunks | |||||
new FixStyleOnlyEntriesPlugin({ | |||||
extensions: ['less', 'scss', 'css', 'svg'], | |||||
silent: true, | |||||
}), | |||||
new MiniCssExtractPlugin({ | new MiniCssExtractPlugin({ | ||||
filename: 'css/[name].css', | filename: 'css/[name].css', | ||||
chunkFilename: 'css/[name].css', | chunkFilename: 'css/[name].css', | ||||
}), | }), | ||||
new SpriteLoaderPlugin({ | |||||
plainSprite: true, | |||||
}), | |||||
new MonacoWebpackPlugin({ | new MonacoWebpackPlugin({ | ||||
filename: 'js/monaco-[name].worker.js', | filename: 'js/monaco-[name].worker.js', | ||||
}) | |||||
}), | |||||
new webpack.ProvidePlugin({ | |||||
Buffer: ['buffer', 'Buffer'] | |||||
}), | |||||
], | ], | ||||
performance: { | performance: { | ||||
hints: false, | hints: false, | ||||
@@ -275,9 +238,9 @@ module.exports = { | |||||
symlinks: false, | symlinks: false, | ||||
alias: { | alias: { | ||||
vue$: 'vue/dist/vue.esm.js', // needed because vue's default export is the runtime only | vue$: 'vue/dist/vue.esm.js', // needed because vue's default export is the runtime only | ||||
'~': resolve(__dirname, 'web_src/vuepages'), | |||||
'~': fileURLToPath(new URL('web_src/vuepages', import.meta.url)) | |||||
}, | }, | ||||
extensions: ['.tsx', '.ts', '.js'] | |||||
extensions: ['.vue', '.ts', '.js'] | |||||
}, | }, | ||||
watchOptions: { | watchOptions: { | ||||
ignored: [ | ignored: [ | ||||
@@ -285,6 +248,23 @@ module.exports = { | |||||
], | ], | ||||
}, | }, | ||||
stats: { | stats: { | ||||
assetsSort: 'name', | |||||
assetsSpace: Infinity, | |||||
cached: false, | |||||
cachedModules: false, | |||||
children: false, | children: false, | ||||
chunkModules: false, | |||||
chunkOrigins: false, | |||||
chunksSort: 'name', | |||||
colors: true, | |||||
entrypoints: false, | |||||
groupAssetsByChunk: false, | |||||
groupAssetsByEmitStatus: false, | |||||
groupAssetsByInfo: false, | |||||
groupModulesByAttributes: false, | |||||
modules: false, | |||||
reasons: false, | |||||
runtimeModules: false, | |||||
}, | }, | ||||
}; | }; |
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》