@pisell/build-plugin-lowcode 1.0.6 → 1.0.7
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 +19 -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.7",
|
|
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,9 @@ 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
|
-
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').
|
|
720
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').options({
|
|
721
|
+
exportType: "named"
|
|
722
|
+
}).before('css-loader');
|
|
715
723
|
});
|
|
716
724
|
return metaPath;
|
|
717
725
|
}
|
|
@@ -917,7 +925,9 @@ async function bundleEditorView(
|
|
|
917
925
|
config.output.library(library).libraryTarget('umd');
|
|
918
926
|
config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
|
|
919
927
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
920
|
-
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').
|
|
928
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').options({
|
|
929
|
+
exportType: "named"
|
|
930
|
+
}).before('css-loader');
|
|
921
931
|
if (baseLibrary === 'rax') {
|
|
922
932
|
const scssRule = config.module.rule('scss');
|
|
923
933
|
scssRule.use('rpx-loader').loader('rpx-loader').before('css-loader');
|
|
@@ -1000,7 +1010,9 @@ async function bundleRenderView(options, pluginOptions, platform, execCompile) {
|
|
|
1000
1010
|
config.output.library(library).libraryTarget('umd');
|
|
1001
1011
|
config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}/render/${platform}`));
|
|
1002
1012
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
1003
|
-
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').
|
|
1013
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').options({
|
|
1014
|
+
exportType: "named"
|
|
1015
|
+
}).before('css-loader');
|
|
1004
1016
|
if (baseLibrary === 'rax') {
|
|
1005
1017
|
const scssRule = config.module.rule('scss');
|
|
1006
1018
|
scssRule.use('rpx-loader').loader('rpx-loader').before('css-loader');
|
|
@@ -1278,7 +1290,9 @@ async function bundleComponentMeta(webPackConfig, options, pluginOptions, execCo
|
|
|
1278
1290
|
config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
|
|
1279
1291
|
config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
|
|
1280
1292
|
useStyleLoader(config);
|
|
1281
|
-
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').
|
|
1293
|
+
config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').options({
|
|
1294
|
+
exportType: "named"
|
|
1295
|
+
}).before('css-loader');
|
|
1282
1296
|
});
|
|
1283
1297
|
})(component, idx);
|
|
1284
1298
|
});
|