zmp-cli 3.11.2 → 3.11.3

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/assets/index.js CHANGED
File without changes
package/build/index.js CHANGED
@@ -80,6 +80,7 @@ module.exports = async (options = {}, logger, { exitOnError = true } = {}) => {
80
80
  scopeBehaviour: 'local',
81
81
  },
82
82
  },
83
+ mode: options.mode,
83
84
  build: {
84
85
  target: 'es2015',
85
86
  outDir: path.join(cwd, 'www'),
package/config/index.js CHANGED
File without changes
package/create/index.js CHANGED
File without changes
@@ -9,7 +9,7 @@ module.exports = function generateAppConfig(options) {
9
9
  headerColor: '#1843EF',
10
10
  textColor: 'white',
11
11
  statusBarColor: '#1843EF',
12
- leftButton: 'both',
12
+ leftButton: 'back',
13
13
  };
14
14
  const routes = generateRoutes(options);
15
15
  // Content
package/deploy/index.js CHANGED
File without changes
package/index.js CHANGED
@@ -119,6 +119,7 @@ program
119
119
  .option('-ios, --ios', 'Run on ios')
120
120
  .option('-nF, --no-frame', 'Run without Zalo frame')
121
121
  .option('-D, --dev', 'Development environment')
122
+ .option('-M, --mode <m>', 'Env mode')
122
123
  .description('Start a ZMP project')
123
124
  .action(async (options) => {
124
125
  const currentProject = getCurrentProject(cwd);
@@ -152,6 +153,7 @@ program
152
153
  showMobileUI: (options && options.showMobileUi) || false,
153
154
  previewOnZalo: (options && options.zaloApp) || false,
154
155
  ios: (options && options.ios) || false,
156
+ mode: options && options.mode,
155
157
  frame:
156
158
  options &&
157
159
  (typeof options.frame === 'undefined' || options.frame === null)
@@ -188,6 +190,7 @@ program
188
190
  .usage('<command> [options]')
189
191
  .command('deploy')
190
192
  .option('-D, --dev', 'Deploy in Development server')
193
+ .option('-M, --mode <m>', 'Env mode')
191
194
  .option(
192
195
  '-P, --port <n>',
193
196
  'Specify UI server port. By default it is 3001',
@@ -202,6 +205,7 @@ program
202
205
  {
203
206
  cwd,
204
207
  dev: options && options.dev,
208
+ mode: options && options.mode,
205
209
  ...opts,
206
210
  },
207
211
  logger
package/login/index.js CHANGED
File without changes
package/migrate/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-cli",
3
- "version": "3.11.2",
3
+ "version": "3.11.3",
4
4
  "description": "ZMP command line utility (CLI)",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -103,4 +103,4 @@
103
103
  "eslint-plugin-promise": "^4.2.1",
104
104
  "eslint-plugin-standard": "^5.0.0"
105
105
  }
106
- }
106
+ }
package/start/index.js CHANGED
@@ -40,6 +40,7 @@ module.exports = async (options = {}, logger, { exitOnError = true } = {}) => {
40
40
  const host = isIOS ? iosHostName : 'localhost';
41
41
  const port = options.port;
42
42
  const remoteDebugPort = port - 2;
43
+ const mode = options.mode || (previewOnZalo ? 'production' : 'development');
43
44
  try {
44
45
  if (previewOnZalo) {
45
46
  const hrConfigPath = path.join(cwd, 'hr.config.json');
@@ -104,11 +105,9 @@ module.exports = async (options = {}, logger, { exitOnError = true } = {}) => {
104
105
  const server = await createServer({
105
106
  configFile: path.join(cwd, viteConfig),
106
107
  root: cwd,
107
- mode: previewOnZalo ? 'production' : 'development',
108
+ mode,
108
109
  define: {
109
- 'process.env.NODE_ENV': JSON.stringify(
110
- previewOnZalo ? 'production' : 'development'
111
- ),
110
+ 'process.env.NODE_ENV': JSON.stringify(mode),
112
111
  'process.env.previewOnZalo': previewOnZalo,
113
112
  },
114
113
  server: {