Skip to content

Commit

Permalink
fix: app json content watch (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoloJiang authored Feb 25, 2021
1 parent 352506c commit ad1b416
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/plugin-rax-app/src/setDev.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const generateTempFile = require('./utils/generateTempFile');

const highlightPrint = chalk.hex('#F4AF3D');

function watchAppJson(log) {
const watcher = chokidar.watch(path.resolve('app.json'), {
function watchAppJson(rootDir, log) {
const watcher = chokidar.watch(path.resolve(rootDir, 'src/app.json'), {
ignoreInitial: true,
});

Expand All @@ -22,7 +22,7 @@ function watchAppJson(log) {
log.info('app.json has been changed');
log.info('restart dev server');
// add process env for mark restart dev process
process.send('RESTART_DEV');
process.send({ type: 'RESTART_DEV' });
});

watcher.on('error', (error) => {
Expand All @@ -43,7 +43,7 @@ module.exports = function (api) {
let krakenMpa = false;
let isFirstCompile = true;
let pha = false;
watchAppJson(log);
watchAppJson(rootDir, log);
const getWebpackInfo = (configs, configName) => {
const taskConfig = configs.find((webpackConfig) => webpackConfig.name === configName);
if (!taskConfig) {
Expand Down

0 comments on commit ad1b416

Please sign in to comment.