@pisell/build-plugin-lowcode 1.0.13-beta.1 → 1.0.13

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.
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="com.codeverse.userSettings.MarscodeWorkspaceAppSettingsState">
4
+ <option name="ckgOperationStatus" value="SUCCESS" />
5
+ <option name="progress" value="0.9230769" />
6
+ </component>
7
+ </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/build-plugin-lowcode",
3
- "version": "1.0.13-beta.1",
3
+ "version": "1.0.13",
4
4
  "description": "build plugin for component-to-lowcode",
5
5
  "main": "src/index.js",
6
6
  "keywords": [
@@ -45,8 +45,6 @@
45
45
  "style-loader": "^2.0.0",
46
46
  "url-loader": "^4.1.1",
47
47
  "webpack": "^4.46.0",
48
- "babel-plugin-import": "1.13.8",
49
- "babel-loader": "8.2.5",
50
48
  "webpack-bundle-analyzer": "4.10.1"
51
49
  },
52
50
  "devDependencies": {
package/src/index.js CHANGED
@@ -255,33 +255,11 @@ const addPostCss = (config) => {
255
255
  .end();
256
256
  }
257
257
 
258
- const addBabelPluginImport = (config) => {
259
- config.module
260
- .rule("ts")
261
- .test(/\.(ts|tsx)$/)
262
- .use("babel-loader")
263
- .loader("babel-loader")
264
- .options({
265
- presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
266
- plugins: [
267
- [
268
- 'import',
269
- {
270
- libraryName: '@pisell/icon',
271
- libraryDirectory: 'es',
272
- camel2DashComponentName: false
273
- },
274
- ],
275
- ]
276
- });
277
- }
278
-
279
258
  const addWebpackBundleAnalyzer = (config) => {
280
259
  config
281
260
  .plugin('bundle-analyzer')
282
261
  .use(BundleAnalyzerPlugin)
283
262
  .end();
284
-
285
263
  }
286
264
 
287
265
  async function registerSetter(context, setterMap) {
@@ -963,8 +941,8 @@ async function bundleEditorView(
963
941
  componentViewsImportStr = _componentViews
964
942
  .map((component) => {
965
943
  const componentNameFolder = camel2KebabComponentName(component);
966
- const viewJsPath = path.resolve(rootDir, `${lowcodeDir}/${componentNameFolder}/view`);
967
- return `import * as ${component}Data from '${viewJsPath}'`;
944
+ const viewJsPath = path.resolve(rootDir, `${lowcodeDir}/${componentNameFolder}/view`).replace(/\\/g, '\\\\');
945
+ return `import * as ${component}Data from '${viewJsPath}';`;
968
946
  })
969
947
  .join('\n');
970
948
  }
@@ -1068,6 +1046,7 @@ async function bundleRenderView(options, pluginOptions, platform, execCompile) {
1068
1046
  lowcodeDir = 'lowcode',
1069
1047
  engineScope = '@ali',
1070
1048
  entryPath,
1049
+ analyze,
1071
1050
  } = pluginOptions || {};
1072
1051
  let componentViews;
1073
1052
  let componentViewsExportStr;
@@ -1131,8 +1110,10 @@ async function bundleRenderView(options, pluginOptions, platform, execCompile) {
1131
1110
 
1132
1111
  config.module.rule('svg').test(/\.svg$/).use('svgr').loader('@svgr/webpack').end().use('url-loader').loader('url-loader').end();
1133
1112
 
1134
- // addWebpackBundleAnalyzer(config);
1135
- addBabelPluginImport(config);
1113
+ if (analyze) {
1114
+ addWebpackBundleAnalyzer(config);
1115
+ }
1116
+ // addBabelPluginImport(config);
1136
1117
  addPostCss(config);
1137
1118
 
1138
1119
  if (baseLibrary === 'rax') {