@pisell/build-plugin-lowcode 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/src/index.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/build-plugin-lowcode",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "build plugin for component-to-lowcode",
5
5
  "main": "src/index.js",
6
6
  "keywords": [
@@ -28,6 +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": "^8.0.1",
31
32
  "axios": "^0.21.4",
32
33
  "build-scripts-config": "^3.0.3",
33
34
  "chokidar": "^3.5.3",
package/src/index.js CHANGED
@@ -507,6 +507,7 @@ async function start(options, pluginOptions) {
507
507
  }
508
508
  config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
509
509
  !disableStyleLoader && useStyleLoader(config);
510
+ config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').before('css-loader');
510
511
  if (baseLibrary === 'rax') {
511
512
  config.module.rule('scss').use('rpx-loader').loader('rpx-loader').before('css-loader');
512
513
  }
@@ -710,6 +711,7 @@ async function bundleMetaV2(options, pluginOptions, execCompile, metaType) {
710
711
  config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
711
712
  config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
712
713
  useStyleLoader(config);
714
+ config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').before('css-loader');
713
715
  });
714
716
  return metaPath;
715
717
  }
@@ -915,6 +917,7 @@ async function bundleEditorView(
915
917
  config.output.library(library).libraryTarget('umd');
916
918
  config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
917
919
  config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
920
+ config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').before('css-loader');
918
921
  if (baseLibrary === 'rax') {
919
922
  const scssRule = config.module.rule('scss');
920
923
  scssRule.use('rpx-loader').loader('rpx-loader').before('css-loader');
@@ -997,6 +1000,7 @@ async function bundleRenderView(options, pluginOptions, platform, execCompile) {
997
1000
  config.output.library(library).libraryTarget('umd');
998
1001
  config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}/render/${platform}`));
999
1002
  config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
1003
+ config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').before('css-loader');
1000
1004
  if (baseLibrary === 'rax') {
1001
1005
  const scssRule = config.module.rule('scss');
1002
1006
  scssRule.use('rpx-loader').loader('rpx-loader').before('css-loader');
@@ -1274,6 +1278,7 @@ async function bundleComponentMeta(webPackConfig, options, pluginOptions, execCo
1274
1278
  config.output.path(path.resolve(rootDir, `${buildTarget}/${lowcodeDir}`));
1275
1279
  config.externals({ ...COMMON_EXTERNALS_MAP[engineScope], ...externals });
1276
1280
  useStyleLoader(config);
1281
+ config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').before('css-loader');
1277
1282
  });
1278
1283
  })(component, idx);
1279
1284
  });