{"library":"start-server-nestjs-webpack-plugin","title":"Start Server NestJS Webpack Plugin","type":"library","description":"This Webpack plugin (current stable version 2.2.5) automatically starts a Node.js server after Webpack's build process completes, primarily intended for development workflows. It streamlines the development loop by restarting the server on code changes, enabling features like Hot Module Reloading (HMR) for server-side code. The plugin allows configuration of the server's entry point via the `name` option, and supports passing arguments to both Node.js and the script itself for debugging or custom behaviors. While its name suggests a specific affinity for NestJS applications, its core functionality is broadly applicable to any Node.js server bundled with Webpack, acting as a convenient orchestrator for development environments. It helps eliminate manual server restarts during active development. However, it's critical to note that version 2.2.5 was last published approximately eight years ago, indicating the project is effectively abandoned and may not be compatible with recent versions of Webpack (v5+) or Node.js.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install start-server-nestjs-webpack-plugin"],"cli":null},"imports":["import StartServerPlugin from 'start-server-nestjs-webpack-plugin';","const StartServerPlugin = require('start-server-nestjs-webpack-plugin');","entry: ['webpack/hot/poll?100', options.entry]"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/douglasgc/start-server-webpack-plugin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/start-server-nestjs-webpack-plugin","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import StartServerPlugin from \"start-server-nestjs-webpack-plugin\";\nimport nodeExternals from 'webpack-node-externals';\nimport webpack from 'webpack';\n\nexport default {\n  // Target node for server-side bundling\n  target: 'node',\n  mode: 'development',\n  entry: {\n    server: ['webpack/hot/poll?100', './src/server.ts'], // Include HMR module\n  },\n  output: {\n    filename: 'server.js',\n    path: require('path').resolve(__dirname, 'dist'),\n  },\n  externals: [\n    nodeExternals({ allowlist: ['webpack/hot/poll?100'] }), // Whitelist HMR module\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.tsx?$/,\n        use: 'ts-loader',\n        exclude: /node_modules/,\n      },\n    ],\n  },\n  resolve: {\n    extensions: ['.tsx', '.ts', '.js'],\n  },\n  plugins: [\n    // Only use this in DEVELOPMENT\n    new StartServerPlugin({\n      name: 'server.js',\n      nodeArgs: ['--inspect'], // allow debugging\n      args: ['--env', 'development'], // pass args to script\n      signal: 'SIGUSR2', // signal to send for HMR\n      keyboard: true, // Allow typing 'rs' to restart the server.\n    }),\n    new webpack.HotModuleReplacementPlugin(), // Enable HMR\n  ],\n};\n","lang":"typescript","description":"This quickstart demonstrates configuring Webpack to use `start-server-nestjs-webpack-plugin` for a Node.js server with TypeScript, including setup for Hot Module Reloading and Node.js debugger integration. This setup is for a typical NestJS application server file located at './src/server.ts' and outputs to 'dist/server.js'.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}