create-blocklet 0.4.9 → 0.4.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-blocklet",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "exports": "./index.js",
5
5
  "type": "module",
6
6
  "repository": "git@github.com:blocklet/create-blocklet.git",
@@ -3,14 +3,18 @@ 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
- publicPath: process.env.PUBLIC_PATH || '/',
11
+ publicPath: whenDev ? '' : process.env.PUBLIC_PATH || '/',
8
12
  devServer: {
9
13
  port,
10
14
  allowedHosts: 'all',
11
15
  client: {
12
16
  // If you want to development this blocklet without blocklet-server, you can delete next line, otherwise the hot reload will be failed.
13
- webSocketURL: 'wss://0.0.0.0/ws',
17
+ webSocketURL: `wss://0.0.0.0${mountPoint}/ws`,
14
18
  },
15
19
  proxy: {
16
20
  '/api': {
@@ -1,13 +1,17 @@
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
+
3
7
  module.exports = {
4
- publicPath: process.env.PUBLIC_PATH || '/',
8
+ publicPath: whenDev ? '' : process.env.PUBLIC_PATH || '/',
5
9
  devServer: {
6
10
  port,
7
11
  allowedHosts: 'all',
8
12
  client: {
9
13
  // If you want to development this blocklet without blocklet-server, you can delete next line, otherwise the hot reload will be failed.
10
- webSocketURL: 'wss://0.0.0.0/ws',
14
+ webSocketURL: `wss://0.0.0.0${mountPoint}/ws`,
11
15
  },
12
16
  },
13
17
  };