@pisell/build-plugin-lowcode 1.0.6 → 1.0.8
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/package.json +4 -3
- package/src/index.js +31 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/build-plugin-lowcode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "build plugin for component-to-lowcode",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@alilc/lowcode-react-renderer": "^1.0.1",
|
|
29
29
|
"@alilc/lowcode-types": "^1.0.1",
|
|
30
30
|
"@alilc/lowcode-utils": "^1.0.1",
|
|
31
|
-
"@svgr/webpack": "^
|
|
31
|
+
"@svgr/webpack": "^5.5.0",
|
|
32
32
|
"axios": "^0.21.4",
|
|
33
33
|
"build-scripts-config": "^3.0.3",
|
|
34
34
|
"chokidar": "^3.5.3",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
42
|
"rpx-loader": "^1.0.1",
|
|
43
43
|
"style-loader": "^2.0.0",
|
|
44
|
-
"webpack": "^4.46.0"
|
|
44
|
+
"webpack": "^4.46.0",
|
|
45
|
+
"url-loader": "^4.1.1"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"np": "^7.7.0"
|
package/src/index.js
CHANGED
|
@@ -507,7 +507,13 @@ async function start(options, pluginOptions) {
|
|
|
507
507
|
}
|
|
508
508
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
509
509
|
!disableStyleLoader && useStyleLoader(config);
|
|
510
|
-
|
|
510
|
+
|
|
511
|
+
// 物料中 svg 图标处理
|
|
512
|
+
config.module
|
|
513
|
+
.rules.delete('svg');
|
|
514
|
+
|
|
515
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').end().use('url-loader').loader('url-loader').end();
|
|
516
|
+
|
|
511
517
|
if (baseLibrary === 'rax') {
|
|
512
518
|
config.module.rule('scss').use('rpx-loader').loader('rpx-loader').before('css-loader');
|
|
513
519
|
}
|
|
@@ -711,7 +717,12 @@ async function bundleMetaV2(options, pluginOptions, execCompile, metaType) {
|
|
|
711
717
|
config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
|
|
712
718
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
713
719
|
useStyleLoader(config);
|
|
714
|
-
|
|
720
|
+
// 物料中 svg 图标处理
|
|
721
|
+
config.module
|
|
722
|
+
.rules.delete('svg');
|
|
723
|
+
|
|
724
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').end().use('url-loader').loader('url-loader').end();
|
|
725
|
+
|
|
715
726
|
});
|
|
716
727
|
return metaPath;
|
|
717
728
|
}
|
|
@@ -917,7 +928,12 @@ async function bundleEditorView(
|
|
|
917
928
|
config.output.library(library).libraryTarget('umd');
|
|
918
929
|
config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
|
|
919
930
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
920
|
-
|
|
931
|
+
// 物料中 svg 图标处理
|
|
932
|
+
config.module
|
|
933
|
+
.rules.delete('svg');
|
|
934
|
+
|
|
935
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').end().use('url-loader').loader('url-loader').end();
|
|
936
|
+
|
|
921
937
|
if (baseLibrary === 'rax') {
|
|
922
938
|
const scssRule = config.module.rule('scss');
|
|
923
939
|
scssRule.use('rpx-loader').loader('rpx-loader').before('css-loader');
|
|
@@ -1000,7 +1016,12 @@ async function bundleRenderView(options, pluginOptions, platform, execCompile) {
|
|
|
1000
1016
|
config.output.library(library).libraryTarget('umd');
|
|
1001
1017
|
config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}/render/${platform}`));
|
|
1002
1018
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
1003
|
-
|
|
1019
|
+
// 物料中 svg 图标处理
|
|
1020
|
+
config.module
|
|
1021
|
+
.rules.delete('svg');
|
|
1022
|
+
|
|
1023
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').end().use('url-loader').loader('url-loader').end();
|
|
1024
|
+
|
|
1004
1025
|
if (baseLibrary === 'rax') {
|
|
1005
1026
|
const scssRule = config.module.rule('scss');
|
|
1006
1027
|
scssRule.use('rpx-loader').loader('rpx-loader').before('css-loader');
|
|
@@ -1278,7 +1299,12 @@ async function bundleComponentMeta(webPackConfig, options, pluginOptions, execCo
|
|
|
1278
1299
|
config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
|
|
1279
1300
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
1280
1301
|
useStyleLoader(config);
|
|
1281
|
-
|
|
1302
|
+
// 物料中 svg 图标处理
|
|
1303
|
+
config.module
|
|
1304
|
+
.rules.delete('svg');
|
|
1305
|
+
|
|
1306
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').end().use('url-loader').loader('url-loader').end();
|
|
1307
|
+
|
|
1282
1308
|
});
|
|
1283
1309
|
})(component, idx);
|
|
1284
1310
|
});
|