Skip to content

Commit

Permalink
refactor: vue-cli-plugin-h-run-devtools => vue-cli-plugin-h-uni-build
Browse files Browse the repository at this point in the history
vue-cli-plugin-h-run-devtools => vue-cli-plugin-h-uni-build
  • Loading branch information
hewx815 committed Jun 3, 2023
1 parent 0dc6a32 commit b902580
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ module.exports = async (api, options) => {
* @name openDevTools
*/
if (openDevTools) {
if (!openDevTools.paths) {
err('缺少\'paths\'配置');
}
// 获取命令文件路径
const commandPath = getCommandPath();
if (!commandPath) {
Expand All @@ -20,7 +23,11 @@ module.exports = async (api, options) => {

// 获取开发者路径
const platFrom = process.env.UNI_PLATFORM;
const devToolPath = openDevTools.path[platFrom];
if (!openDevTools.paths[platFrom]) {
err(`缺少paths.${platFrom}配置`);
return;
}
const devToolPath = openDevTools.paths[platFrom];
if (!validPath(devToolPath)) {
err(`没有这样的文件夹:${devToolPath}`);
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable no-unused-vars */
// eslint-disable-next-line import/no-extraneous-dependencies
const inquirer = require('inquirer');
// const inquirer = require('inquirer');

module.exports = async (api, options) => {
console.log(1111111111);
const { setMode, beforeBuild } = options.pluginOptions['h-uni-build'] ? options.pluginOptions['h-uni-build'] : {};

if (beforeBuild) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const afterBuild = require('./afterBuild');
const beforeBuild = require('./beforeBuild');

console.log(111111111111111);

module.exports = (api, options) => {
const serve = api.service.commands['uni-build'];
const serveFn = serve.fn;
Expand Down
6 changes: 5 additions & 1 deletion for-vue2/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
module.exports = {
pluginOptions: {
'h-uni-build': {
// openDevTools: {},
openDevTools: {
paths: {
'mp-weixin': 'D:\\wechatDev\\微信web开发者工具',
},
},
// setMode: [],
// beforeBuild: () => {},
// afterBuild: () => {},
Expand Down

0 comments on commit b902580

Please sign in to comment.