基础

配套 前端react-admin

日志处理

module.exports = function(options) { return { …options, entry: [‘webpack/hot/poll?100’, options.entry], externals: [ nodeExternals({ allowlist: [‘webpack/hot/poll?100’], }), ], plugins: [ …options.plugins, new webpack.HotModuleReplacementPlugin(), new webpack.WatchIgnorePlugin({ paths: [/.js$/, /.d.ts$/] }), new StartServerPlugin({ name: options.output.filename }), ], }; };

  1. - package.json
  2. - `"start:dev": "nest build --webpack --webpackPath webpack-hmr.config.js"`
  3. <a name="83MMO"></a>
  4. ### 建立实体(示例)
  5. ```javascript
  6. import {
  7. BaseEntity,
  8. Column,
  9. Entity,
  10. PrimaryGeneratedColumn,
  11. } from 'typeorm';
  12. @Entity('user', { schema: 'koa' })
  13. export class UserEntity extends BaseEntity {
  14. @PrimaryGeneratedColumn({
  15. type: 'int',
  16. name: 'id',
  17. })
  18. id: number;
  19. @Column('varchar', {
  20. nullable: false,
  21. unique: true,
  22. length: 150,
  23. name: 'uuid',
  24. generated: 'uuid',
  25. })
  26. uuid: string;
  27. @Column('varchar', {
  28. nullable: false,
  29. unique: true,
  30. length: 100,
  31. name: 'name',
  32. })
  33. name: string;
  34. @Column('varchar', {
  35. nullable: false,
  36. name: 'password',
  37. })
  38. password: string;
  39. @Column('varchar', {
  40. nullable: true,
  41. length: 100,
  42. name: 'email',
  43. })
  44. email: string | null;
  45. @Column('varchar', {
  46. nullable: true,
  47. length: 11,
  48. name: 'mobile',
  49. })
  50. mobile: string | null;
  51. @Column('tinyint', {
  52. nullable: true,
  53. default: () => 0,
  54. name: 'gender',
  55. })
  56. gender: number | null;
  57. @Column('timestamp', {
  58. nullable: false,
  59. default: () => 'CURRENT_TIMESTAMP',
  60. name: 'create_at',
  61. })
  62. createAt: Date;
  63. @Column('timestamp', {
  64. nullable: false,
  65. default: () => 'CURRENT_TIMESTAMP',
  66. name: 'update_at',
  67. })
  68. updateAt: Date;
  69. }