Skip to content

Commit

Permalink
fix(e2e): $$符号uglifyJS不支持压缩
Browse files Browse the repository at this point in the history
re #80
  • Loading branch information
fanniehuang committed Jan 27, 2021
1 parent 26ea973 commit b490ae9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 55 deletions.
2 changes: 1 addition & 1 deletion packages/wxa-cli/src/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let debug = debugPKG('WXA:Builder');
class Builder {
constructor(wxaConfigs) {
this.current = process.cwd();
this.wxaConfigs = wxaConfigs[0];
this.wxaConfigs = wxaConfigs[0] || wxaConfigs;
// default wxa configurations.
this.wxaConfigs.resolve.appConfigPath = path.join(this.wxaConfigs.context, 'app.json');
if (this.wxaConfigs.resolve.wxaExt[0] !== '.') this.wxaConfigs.resolve.wxaExt = '.'+this.wxaConfigs.resolve.wxaExt;
Expand Down
4 changes: 2 additions & 2 deletions packages/wxa-cli/src/tester/e2eTester.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class TesterScheduler extends Schedule {
(/exports\.default/gm.test(mdl.code) || /exports\[["']default["']/gm.test(mdl.code))
) {
mdl.code = `
let $$testSuitePlugin = require('wxa://wxa-e2eTest/e2eTestSuite.js');
require('@wxa/core').wxa.use($$testSuitePlugin, {record: ${!!this.cmdOptions.record}});
var __testSuitePlugin = require('wxa://wxa-e2eTest/e2eTestSuite.js');
require('@wxa/core').wxa.use(__testSuitePlugin, {record: ${!!this.cmdOptions.record}});
${mdl.code}
`;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wxa-cli/src/tester/readMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

### 测试脚本回放
* `npm i -g jest`
* 项目下执行 `npm i miniprogram-automator looks-same`
* 项目下执行 `npm i -DE miniprogram-automator looks-same`
* 开发者工具修改调试基础库 2.7.3以上(src/project.config.json需同步修改libVersion)
* 项目根目录下添加文件`babel.config.js`
```
Expand Down
51 changes: 0 additions & 51 deletions packages/wxa-cli/src/wxa.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,57 +106,6 @@ commander
new Tester(cmd, wxaConfigs).build();
});

commander
.command('create')
.description('新建模板')
.action(async (cmd)=>{
logger.info('Hey', `This is ${chalk.keyword('orange')('wxa@'+version)}, Running in ${chalk.keyword('orange')(process.env.NODE_ENV || 'development')}`);
logger.info('Creating', '新建项目中😋');

let opts = await inquirer.prompt([
{
type: 'input',
name: 'projectName',
message: '输入项目名',
validate: (input)=>{
return !(input == null || input === '');
},
},
{
type: 'list',
name: 'template',
message: '选择模板',
default: 'base',
choices: [
{
name: '基础模板,默认配置文件',
value: 'base',
},
{
name: 'Redux模板,使用redux管理全局状态',
value: 'redux',
},
{
name: 'Vant模板, 使用有赞ui加速小程序开发',
value: 'vant',
},
{
name: 'Echart模板, 使用echart开发小程序图表',
value: 'echart',
},
],
},
{
type: 'input',
name: 'appid',
message: '小程序APPID',
default: '',
},
]);

new Creator(cmd).run(opts);
});

commander
.command('cli')
.description('微信开发者工具命令行调用')
Expand Down

0 comments on commit b490ae9

Please sign in to comment.