mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-11-30 03:07:36 +08:00
17 lines
394 B
JavaScript
17 lines
394 B
JavaScript
const path = require('path');
|
|
const templates = path.resolve(process.cwd(), './examples/pages/template');
|
|
|
|
const chokidar = require('chokidar');
|
|
let watcher = chokidar.watch([templates]);
|
|
|
|
watcher.on('ready', function() {
|
|
watcher
|
|
.on('change', function() {
|
|
exec('npm run i18n');
|
|
});
|
|
});
|
|
|
|
function exec(cmd) {
|
|
return require('child_process').execSync(cmd).toString().trim();
|
|
}
|