create-blocklet 0.4.6 → 0.4.9
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
CHANGED
|
@@ -3,12 +3,29 @@ require('dotenv-flow').config();
|
|
|
3
3
|
const port = process.env.BLOCKLET_PORT || process.env.PORT || 3000;
|
|
4
4
|
const apiPort = process.env.API_PORT || 3030;
|
|
5
5
|
|
|
6
|
+
const whenDev = process.env.NODE_ENV === 'development';
|
|
7
|
+
|
|
8
|
+
const mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
9
|
+
|
|
10
|
+
const webpackConfig = whenDev
|
|
11
|
+
? {
|
|
12
|
+
configure: {
|
|
13
|
+
output: {
|
|
14
|
+
publicPath: '', // When the dev mode as component, this line required
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
: {};
|
|
19
|
+
|
|
6
20
|
module.exports = {
|
|
21
|
+
webpack: {
|
|
22
|
+
...webpackConfig,
|
|
23
|
+
},
|
|
7
24
|
devServer: {
|
|
8
25
|
port,
|
|
9
26
|
client: {
|
|
10
27
|
// If you want to development this blocklet without blocklet-server, you can delete next line, otherwise the hot reload will be failed.
|
|
11
|
-
webSocketURL:
|
|
28
|
+
webSocketURL: `wss://0.0.0.0${mountPoint}/ws`,
|
|
12
29
|
},
|
|
13
30
|
proxy: {
|
|
14
31
|
'/api': {
|
|
@@ -3,12 +3,16 @@ require('dotenv-flow').config();
|
|
|
3
3
|
const port = process.env.BLOCKLET_PORT || process.env.PORT || 3000;
|
|
4
4
|
const apiPort = process.env.API_PORT || 3030;
|
|
5
5
|
|
|
6
|
+
const whenDev = process.env.NODE_ENV === 'development';
|
|
7
|
+
|
|
8
|
+
const mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
9
|
+
|
|
6
10
|
module.exports = {
|
|
7
11
|
devServer: {
|
|
8
12
|
port,
|
|
9
13
|
client: {
|
|
10
14
|
// If you want to development this blocklet without blocklet-server, you can delete next line, otherwise the hot reload will be failed.
|
|
11
|
-
webSocketURL:
|
|
15
|
+
webSocketURL: `wss://0.0.0.0${mountPoint}/ws`,
|
|
12
16
|
},
|
|
13
17
|
proxy: [
|
|
14
18
|
{
|
|
@@ -27,6 +31,11 @@ module.exports = {
|
|
|
27
31
|
module: {
|
|
28
32
|
noParse: /gun\.js$/,
|
|
29
33
|
},
|
|
34
|
+
output: whenDev
|
|
35
|
+
? {
|
|
36
|
+
publicPath: '', // When the dev mode as component, this line required
|
|
37
|
+
}
|
|
38
|
+
: {},
|
|
30
39
|
},
|
|
31
40
|
},
|
|
32
41
|
};
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
const port = process.env.BLOCKLET_PORT || process.env.PORT || 3000;
|
|
2
2
|
|
|
3
|
+
const whenDev = process.env.NODE_ENV === 'development';
|
|
4
|
+
|
|
5
|
+
const mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
6
|
+
|
|
7
|
+
const webpackConfig = whenDev
|
|
8
|
+
? {
|
|
9
|
+
configure: {
|
|
10
|
+
output: {
|
|
11
|
+
publicPath: '', // When the dev mode as component, this line required
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
: {};
|
|
16
|
+
|
|
3
17
|
module.exports = {
|
|
18
|
+
webpack: {
|
|
19
|
+
...webpackConfig,
|
|
20
|
+
},
|
|
4
21
|
devServer: {
|
|
5
22
|
port,
|
|
6
23
|
client: {
|
|
7
24
|
// If you want to development this blocklet without blocklet-server, you can delete next line, otherwise the hot reload will be failed.
|
|
8
|
-
webSocketURL:
|
|
25
|
+
webSocketURL: `wss://0.0.0.0${mountPoint}/ws`,
|
|
9
26
|
},
|
|
10
27
|
},
|
|
11
28
|
};
|