Nodemon: --menonton satu file

Dibuat pada 20 Feb 2014  ·  4Komentar  ·  Sumber: remy/nodemon

Saya ingin menonton semua file di direktori tertentu dan satu file di direktori lain. Sepertinya ini tidak didukung.

C:\Stimulant\Source\ampm>nodemon --dump --watch . --watch ../ampm-test/WPF-test/
config.json server.js ../ampm-test/WPF-test/config.json
20 Feb 11:33:38 - [nodemon] v1.0.15
20 Feb 11:33:38 - [nodemon] to restart at any time, enter `rs`
20 Feb 11:33:38 - [nodemon] watching: *.* ../ampm-test/WPF-test/config.json
--------------
{ run: false,
  system:
   { cwd: 'C:\\Stimulant\\Source\\ampm',
     useFind: false,
     useWatch: true,
     useWatchFile: false },
  required: false,
  dirs: [ 'C:\\Stimulant\\Source\\ampm' ],
  timeout: 1000,
  options:
   { scriptPosition: 0,
     dump: true,
     watch:
      [ '.',
        '../ampm-test/WPF-test/config.json',
        re: /\.|\.\./ampm\-test/WPF\-test/config\.json/ ],
     script: 'server.js',
     args: [ '../ampm-test/WPF-test/config.json' ],
     restartable: 'rs',
     ignore:
      [ '.git',
        'node_modules/**/node_modules',
        'view',
        'samples',
        'logs',
        'app',
        'content',
        re: /\.git|node_modules/.*.*/node_modules|view|samples|logs|app|content/
 ],
     verbose: false,
     ext: 'js,json',
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     stdout: true,
     execOptions:
      { script: 'server.js',
        exec: 'node',
        nodeArgs: undefined,
        ext: 'js,json',
        env: {},
        execArgs: [] },
     monitor:
      [ '*.*',
        '../ampm-test/WPF-test/config.json',
        '!C:\\Stimulant\\Source\\ampm\\.git/**/*',
        '!node_modules/**/node_modules',
        '!C:\\Stimulant\\Source\\ampm\\view/**/*',
        '!C:\\Stimulant\\Source\\ampm\\samples/**/*',
        '!logs',
        '!app',
        '!content' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [ 'C:\\Stimulant\\Source\\ampm\\nodemon.json' ],
  command:
   { raw:
      { executable: 'node',
        args: [ 'server.js', '../ampm-test/WPF-test/config.json' ] },
     string: 'node server.js ../ampm-test/WPF-test/config.json' } }
--------------
OS: win32 x64
node: v0.10.26
nodemon: v1.0.15
cwd: C:\Stimulant\Source\ampm
command: node C:\Users\josh.STIMULANT\AppData\Roaming\npm\node_modules\nodemon\b
in\nodemon.js --dump --watch . --watch ../ampm-test/WPF-test/config.json server.
js ../ampm-test/WPF-test/config.json
--------------

Komentar yang paling membantu

Repro lebih sederhana...

C:\Stimulant\Source\ampm>nodemon server.js --watch ../ampm-test/WPF-test/config.json ../ampm-test/WPF-test/config.json
1 Mar 12:01:33 - [nodemon] v1.0.15
1 Mar 12:01:33 - [nodemon] to restart at any time, enter `rs`
1 Mar 12:01:33 - [nodemon] watching: ../ampm-test/WPF-test/config.json
1 Mar 12:01:33 - [nodemon] starting `node server.js ../ampm-test/WPF-test/config.json`

Sekarang saya menyuruhnya untuk menonton satu file saja. Outputnya sepertinya melakukan hal yang benar, tetapi tidak ada yang terjadi ketika file json berubah.

Semua 4 komentar

Hmm, output dari pengaturan monitor terlihat benar. Saya harus membuat tes yang memiliki tata letak ini untuk memeriksanya dan men-debug sendiri.

Repro lebih sederhana...

C:\Stimulant\Source\ampm>nodemon server.js --watch ../ampm-test/WPF-test/config.json ../ampm-test/WPF-test/config.json
1 Mar 12:01:33 - [nodemon] v1.0.15
1 Mar 12:01:33 - [nodemon] to restart at any time, enter `rs`
1 Mar 12:01:33 - [nodemon] watching: ../ampm-test/WPF-test/config.json
1 Mar 12:01:33 - [nodemon] starting `node server.js ../ampm-test/WPF-test/config.json`

Sekarang saya menyuruhnya untuk menonton satu file saja. Outputnya sepertinya melakukan hal yang benar, tetapi tidak ada yang terjadi ketika file json berubah.

Bahkan dengan jalur absolut, tidak ada yang terjadi saat file berubah.

C:\Stimulant\Source\ampm>nodemon server.js --watch C:\Stimulant\Source\ampm-test\WPF-test\config.json ../ampm-test/WPF-test/config.json
1 Mar 12:03:03 - [nodemon] v1.0.15
1 Mar 12:03:03 - [nodemon] to restart at any time, enter `rs`
1 Mar 12:03:03 - [nodemon] watching: C:\Stimulant\Source\ampm-test\WPF-test\config.json
1 Mar 12:03:03 - [nodemon] starting `node server.js ../ampm-test/WPF-test/config.json`

Sudahkah Anda mencoba menentukan ekstensi? Lihat #308.

Apakah halaman ini membantu?
0 / 5 - 0 peringkat