@pisell/build-plugin-lowcode 1.0.13-beta.1 → 1.0.13-beta.2
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 +1 -3
- package/src/index.js +5 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/build-plugin-lowcode",
|
|
3
|
-
"version": "1.0.13-beta.
|
|
3
|
+
"version": "1.0.13-beta.2",
|
|
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) {
|
|
@@ -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
|
-
|
|
1135
|
-
|
|
1113
|
+
if (analyze) {
|
|
1114
|
+
addWebpackBundleAnalyzer(config);
|
|
1115
|
+
}
|
|
1116
|
+
// addBabelPluginImport(config);
|
|
1136
1117
|
addPostCss(config);
|
|
1137
1118
|
|
|
1138
1119
|
if (baseLibrary === 'rax') {
|