devserver.js 827 B

123456789101112131415161718192021222324252627
  1. /**
  2. * Run the devserver.
  3. *
  4. * IMPORTANT: Configuration should match `dist/browserify.js`!
  5. */
  6. const budo = require('budo')
  7. const babelify = require('babelify')
  8. const babelifyConfig = require('./babelify-config.js');
  9. const tsify = require('tsify');
  10. budo('src/app.ts:dist/app.js', {
  11. dir: ['public', '.', 'src'],
  12. live: true,
  13. stream: process.stdout,
  14. port: 9966,
  15. debug: true,
  16. //browserify: { // TODO: See #705
  17. // plugin: tsify,
  18. // transform: [babelify.configure(babelifyConfig)],
  19. //},
  20. browserifyArgs: ['-d', '-p', 'tsify', '-t', '[', 'babelify', '--presets', '[', '@babel/env', ']', '--extensions', '.ts', ']'],
  21. }).on('connect', (ev) => {
  22. console.log('Server running on %s', ev.uri);
  23. }).on('update', (buffer) => {
  24. console.log('Bundle update, %d bytes', buffer.length);
  25. });