@easyv/react-component-builder 0.23.0-beta.0 → 0.23.1
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/config/webpack.config.build.js +2 -1
- package/config/webpack.config.common.js +7 -6
- package/config/webpack.config.js +3 -3
- package/launcher/build.js +1 -3
- package/launcher/start.js +4 -4
- package/loaders/react-entry-loader.js +4 -1
- package/package.json +18 -15
- package/public/component.ejs +1 -1
|
@@ -24,7 +24,8 @@ module.exports = (
|
|
|
24
24
|
output: {
|
|
25
25
|
path: appBuild,
|
|
26
26
|
filename: `${module_name}.${version}.js`,
|
|
27
|
-
library:
|
|
27
|
+
library: `${module_name}@${version}`,
|
|
28
|
+
libraryTarget: 'amd',
|
|
28
29
|
},
|
|
29
30
|
externals: [
|
|
30
31
|
'react',
|
|
@@ -54,7 +54,9 @@ module.exports = function ({ isProduction, uniqueId, entrys }) {
|
|
|
54
54
|
|
|
55
55
|
{
|
|
56
56
|
test: /\.js\.map$/,
|
|
57
|
-
|
|
57
|
+
use: {
|
|
58
|
+
loader: "file-loader",
|
|
59
|
+
},
|
|
58
60
|
},
|
|
59
61
|
|
|
60
62
|
{
|
|
@@ -102,12 +104,11 @@ module.exports = function ({ isProduction, uniqueId, entrys }) {
|
|
|
102
104
|
],
|
|
103
105
|
},
|
|
104
106
|
{
|
|
107
|
+
// exclude: /node_modules/,
|
|
105
108
|
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)(\?.*$|$)/,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
maxSize: 20 * 1024 * 1024,
|
|
110
|
-
},
|
|
109
|
+
loader: "url-loader",
|
|
110
|
+
options: {
|
|
111
|
+
limit: 20 * 1024 * 1024,
|
|
111
112
|
},
|
|
112
113
|
},
|
|
113
114
|
].filter(Boolean),
|
package/config/webpack.config.js
CHANGED
|
@@ -34,7 +34,8 @@ module.exports = ({ port, modules }) => {
|
|
|
34
34
|
output: {
|
|
35
35
|
filename: '[name].js',
|
|
36
36
|
globalObject: 'this',
|
|
37
|
-
|
|
37
|
+
libraryTarget: 'var',
|
|
38
|
+
library: '__MAIN__', // 暴露到window上的属性名称
|
|
38
39
|
},
|
|
39
40
|
devtool: 'source-map',
|
|
40
41
|
plugins: [
|
|
@@ -74,7 +75,7 @@ module.exports = ({ port, modules }) => {
|
|
|
74
75
|
client: {
|
|
75
76
|
logging: 'warn',
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
+
onBeforeSetupMiddleware: function (devServer) {
|
|
78
79
|
if (!devServer) {
|
|
79
80
|
throw new Error('webpack-dev-server is not defined');
|
|
80
81
|
}
|
|
@@ -117,7 +118,6 @@ module.exports = ({ port, modules }) => {
|
|
|
117
118
|
res.send(data);
|
|
118
119
|
});
|
|
119
120
|
});
|
|
120
|
-
return middlewares;
|
|
121
121
|
},
|
|
122
122
|
},
|
|
123
123
|
};
|
package/launcher/build.js
CHANGED
|
@@ -110,10 +110,8 @@ module.exports = (name, option = {}) => {
|
|
|
110
110
|
|
|
111
111
|
console.log();
|
|
112
112
|
}
|
|
113
|
-
const mainAsset = message.assetsByChunkName.main;
|
|
114
|
-
const mainFile = Array.isArray(mainAsset) ? mainAsset[0] : mainAsset;
|
|
115
113
|
resolve({
|
|
116
|
-
file: path.join(message.outputPath,
|
|
114
|
+
file: path.join(message.outputPath, message.assetsByChunkName.main),
|
|
117
115
|
base,
|
|
118
116
|
sourcePath: sourcePath,
|
|
119
117
|
});
|
package/launcher/start.js
CHANGED
|
@@ -124,10 +124,9 @@ function start({ port, modules }) {
|
|
|
124
124
|
},
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
const
|
|
128
|
-
const server = new WebpackDevServer(devServerOptions, compiler);
|
|
127
|
+
const server = new WebpackDevServer(compiler, config.devServer);
|
|
129
128
|
|
|
130
|
-
server.
|
|
129
|
+
server.listen(port, HOST, (err) => {
|
|
131
130
|
if (err) {
|
|
132
131
|
return console.log(err);
|
|
133
132
|
}
|
|
@@ -141,7 +140,8 @@ function start({ port, modules }) {
|
|
|
141
140
|
|
|
142
141
|
['SIGINT', 'SIGTERM'].forEach(function (sig) {
|
|
143
142
|
process.on(sig, function () {
|
|
144
|
-
server.
|
|
143
|
+
server.close();
|
|
144
|
+
process.exit();
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
}
|
|
@@ -235,7 +235,10 @@ module.exports = function (content, map, meta) {
|
|
|
235
235
|
main.commonAssets = commonAssets;
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
const id = Math.
|
|
238
|
+
const id = Math.floor(
|
|
239
|
+
(Math.random() + Math.floor(Math.random() * 9 + 1)) *
|
|
240
|
+
Math.pow(10, 11),
|
|
241
|
+
);
|
|
239
242
|
config.id = id;
|
|
240
243
|
data.id = id;
|
|
241
244
|
subConfigs.push(config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyv/react-component-builder",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"launcher",
|
|
6
6
|
"templates",
|
|
@@ -17,37 +17,41 @@
|
|
|
17
17
|
"postpublish": "sync-to-mirror"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@babel/core": "
|
|
20
|
+
"@babel/core": "7.9.0",
|
|
21
21
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
22
22
|
"@babel/register": "^7.10.4",
|
|
23
|
-
"@easyv/react-gui": "1.
|
|
24
|
-
"@easyv/simulator": "0.6.
|
|
23
|
+
"@easyv/react-gui": "3.1.0",
|
|
24
|
+
"@easyv/simulator": "0.6.10",
|
|
25
25
|
"@svgr/webpack": "8.1.0",
|
|
26
26
|
"acorn": "^7.3.1",
|
|
27
27
|
"acorn-jsx": "^5.2.0",
|
|
28
28
|
"antd": "^4.0.3",
|
|
29
|
-
"babel-loader": "
|
|
29
|
+
"babel-loader": "8.1.0",
|
|
30
30
|
"babel-plugin-named-asset-import": "^0.3.6",
|
|
31
31
|
"babel-preset-react-app": "^10.0.1",
|
|
32
32
|
"classnames": "^2.2.6",
|
|
33
|
-
"css-loader": "
|
|
33
|
+
"css-loader": "3.4.2",
|
|
34
34
|
"d3": "^5.16.0",
|
|
35
|
-
"expose-loader": "^
|
|
35
|
+
"expose-loader": "^1.0.0",
|
|
36
|
+
"file-loader": "4.3.0",
|
|
36
37
|
"filesize": "^6.1.0",
|
|
37
38
|
"fs-extra": "^9.0.1",
|
|
38
39
|
"glob": "^7.1.6",
|
|
39
|
-
"html-webpack-plugin": "
|
|
40
|
+
"html-webpack-plugin": "4.5.2",
|
|
40
41
|
"inquirer": "^7.3.0",
|
|
41
|
-
"less-loader": "^
|
|
42
|
+
"less-loader": "^6.2.0",
|
|
42
43
|
"lodash": "^4.17.19",
|
|
43
44
|
"multer": "^1.4.2",
|
|
45
|
+
"optimize-css-assets-webpack-plugin": "6.0.1",
|
|
44
46
|
"react": "^16.13.1",
|
|
45
47
|
"react-dev-utils": "10.2.1",
|
|
46
48
|
"react-dom": "^16.13.1",
|
|
47
|
-
"style-loader": "
|
|
49
|
+
"style-loader": "0.23.1",
|
|
48
50
|
"three": "^0.100.0",
|
|
49
|
-
"
|
|
50
|
-
"webpack
|
|
51
|
+
"url-loader": "2.3.0",
|
|
52
|
+
"webpack": "4.47.0",
|
|
53
|
+
"webpack-dev-server": "4.15.1",
|
|
54
|
+
"webpack-manifest-plugin": "4.1.1"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@easyv/sync-to-mirror": "^0.0.2",
|
|
@@ -55,8 +59,7 @@
|
|
|
55
59
|
"@types/node": "^12.0.0",
|
|
56
60
|
"@types/react": "^16.9.0",
|
|
57
61
|
"@types/react-dom": "^16.9.0",
|
|
58
|
-
"
|
|
59
|
-
"terser-webpack-plugin": "^5.3.10"
|
|
62
|
+
"terser-webpack-plugin": "^4.2.3"
|
|
60
63
|
},
|
|
61
64
|
"easyv": {
|
|
62
65
|
"src": "examples",
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
"online": "https://easyv.dtstack.com",
|
|
67
70
|
"test": "http://172.16.10.70:1337"
|
|
68
71
|
},
|
|
69
|
-
"assets": "https://
|
|
72
|
+
"assets": "https://easyv-develop.oss-cn-hangzhou.aliyuncs.com/"
|
|
70
73
|
},
|
|
71
74
|
"publishConfig": {
|
|
72
75
|
"registry": "https://registry.npmjs.org/"
|
package/public/component.ejs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<script src="static/react/umd/react.development.js"></script>
|
|
13
13
|
<script src="static/react-dom/umd/react-dom.development.js"></script>
|
|
14
|
-
<script src="static/@easyv/react-gui/
|
|
14
|
+
<script src="static/@easyv/react-gui/dist/index.js"></script>
|
|
15
15
|
<script>
|
|
16
16
|
window.react = React;
|
|
17
17
|
window["@easyv/react-gui"] = window["react-gui"];
|