@focus-teach/ui 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-temp/zw-ai-report.js +20 -0
- package/api/index.js +113 -9
- package/lib/ui.common.js +49085 -7305
- package/lib/ui.css +2 -2
- package/lib/ui.umd.js +49085 -7305
- package/lib/ui.umd.min.js +49 -20
- package/package.json +8 -4
- package/report.20260114.105913.20380.0.001.json +643 -0
- package/report.20260114.105916.34220.0.001.json +642 -0
- package/report.20260114.105916.40240.0.001.json +645 -0
- package/utils/index.js +1 -1
- package/vue.config copy.js +0 -139
package/vue.config copy.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const os = require("os");
|
|
3
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
4
|
-
const FileManagerPlugin = require('filemanager-webpack-plugin');
|
|
5
|
-
|
|
6
|
-
const env = process.env.NODE_ENV;
|
|
7
|
-
const isProd = env === 'production';
|
|
8
|
-
|
|
9
|
-
// --- 环境变量与IP路径映射 ---
|
|
10
|
-
const networkInterfaces = os.networkInterfaces();
|
|
11
|
-
const curDevBranch = 'FT_2026.01';
|
|
12
|
-
const IPMap = new Map([
|
|
13
|
-
['10.10.14.101', 'D:\\Projects\\Code\\DevBranch'],
|
|
14
|
-
['10.10.14.91', 'D:\\teaching'],['10.10.14.68', 'D:\\project']
|
|
15
|
-
]);
|
|
16
|
-
|
|
17
|
-
const getIP = () => {
|
|
18
|
-
for (const interfaceName in networkInterfaces) {
|
|
19
|
-
for (const iface of networkInterfaces[interfaceName]) {
|
|
20
|
-
if (iface.family === 'IPv4' && !iface.internal) {
|
|
21
|
-
return iface.address;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return '';
|
|
26
|
-
};
|
|
27
|
-
const localIp = getIP();
|
|
28
|
-
const curDirPrefix = IPMap.get(localIp) ? `${IPMap.get(localIp)}\\${curDevBranch}` : '';
|
|
29
|
-
|
|
30
|
-
// 💡 自定义微型插件:在库打包生成后,安全地将默认的 CSS 名称改为 ui.css
|
|
31
|
-
class RenameCssPlugin {
|
|
32
|
-
apply(compiler) {
|
|
33
|
-
// 使用 afterEmit 钩子,在文件输出到 lib 目录后立即执行
|
|
34
|
-
compiler.hooks.afterEmit.tap('RenameCssPlugin', () => {
|
|
35
|
-
const fs = require('fs');
|
|
36
|
-
const libDir = path.resolve(__dirname, 'lib');
|
|
37
|
-
if (fs.existsSync(libDir)) {
|
|
38
|
-
const files = fs.readdirSync(libDir);
|
|
39
|
-
// 寻找 Vue CLI 默认生成的那个 CSS 文件 (排除原本就是 ui.css 的情况)
|
|
40
|
-
const cssFile = files.find(f => f.endsWith('.css') && f !== 'ui.css');
|
|
41
|
-
if (cssFile) {
|
|
42
|
-
fs.renameSync(
|
|
43
|
-
path.join(libDir, cssFile),
|
|
44
|
-
path.join(libDir, 'ui.css')
|
|
45
|
-
);
|
|
46
|
-
console.log(`\n✅ 样式文件已成功合并并重命名为 ui.css`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
module.exports = {
|
|
54
|
-
outputDir: path.resolve(__dirname, 'lib'),
|
|
55
|
-
publicPath: '/',
|
|
56
|
-
productionSourceMap: false,
|
|
57
|
-
runtimeCompiler: true,
|
|
58
|
-
parallel: false,
|
|
59
|
-
|
|
60
|
-
devServer: {
|
|
61
|
-
proxy: {
|
|
62
|
-
'/backend': {
|
|
63
|
-
target: 'http://10.10.14.101:8085',
|
|
64
|
-
changeOrigin: true,
|
|
65
|
-
pathRewrite: { '^/backend': '/' }
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
pages: {
|
|
71
|
-
index: {
|
|
72
|
-
entry: "examples/main.js",
|
|
73
|
-
template: "public/index.html",
|
|
74
|
-
filename: "index.html"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
css: {
|
|
79
|
-
sourceMap: false,
|
|
80
|
-
loaderOptions: {
|
|
81
|
-
scss: {
|
|
82
|
-
additionalData: '',
|
|
83
|
-
sassOptions: { outputStyle: 'expanded' }
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
configureWebpack: {
|
|
89
|
-
resolve: {
|
|
90
|
-
alias: {
|
|
91
|
-
'@packages': path.resolve(__dirname, 'packages'),
|
|
92
|
-
'@assets': path.resolve(__dirname, 'assets'),
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
output: {
|
|
96
|
-
filename: 'packages/[name]/[name].js',
|
|
97
|
-
},
|
|
98
|
-
optimization: {
|
|
99
|
-
minimizer:[
|
|
100
|
-
new TerserPlugin({
|
|
101
|
-
extractComments: false,
|
|
102
|
-
terserOptions: {
|
|
103
|
-
compress: {
|
|
104
|
-
drop_console: isProd,
|
|
105
|
-
drop_debugger: isProd,
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
],
|
|
110
|
-
},
|
|
111
|
-
plugins:[
|
|
112
|
-
// 先执行重命名插件,将生成的 CSS 改名
|
|
113
|
-
isProd ? new RenameCssPlugin() : null,
|
|
114
|
-
isProd && curDirPrefix ? new FileManagerPlugin({
|
|
115
|
-
onEnd: {
|
|
116
|
-
copy:[
|
|
117
|
-
{ source: path.resolve(__dirname, 'lib'), destination: `${curDirPrefix}\\hq_studyfun\\src\\main\\webapp\\assets\\common\\@focus-teach\\ui\\v2` },
|
|
118
|
-
{ source: path.resolve(__dirname, 'lib'), destination: `${curDirPrefix}\\ol_studyfun_qd\\handle-exception-card\\node_modules\\@focus-teach\\ui\\lib` },
|
|
119
|
-
{ source: path.resolve(__dirname, 'lib'), destination: `${curDirPrefix}\\ol_studyfun_qd\\h5-mini-program-wechat\\node_modules\\@focus-teach\\ui\\lib` },
|
|
120
|
-
{ source: path.resolve(__dirname, 'lib'), destination: `${curDirPrefix}\\ol_studyfun_qd\\prepare-course\\node_modules\\@focus-teach\\ui\\lib` },
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
}) : null,
|
|
124
|
-
].filter(Boolean) // 过滤掉 null 元素
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
chainWebpack: config => {
|
|
128
|
-
// SVG 处理保持不变
|
|
129
|
-
const svgRule = config.module.rule('svg');
|
|
130
|
-
svgRule.uses.clear();
|
|
131
|
-
svgRule
|
|
132
|
-
.use('url-loader')
|
|
133
|
-
.loader('url-loader')
|
|
134
|
-
.options({
|
|
135
|
-
limit: 10000,
|
|
136
|
-
name: '[name].[hash:7].[ext]'
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|