2.2.5 • Published 6 years ago

start-server-webpack-plugin v2.2.5

Weekly downloads
52,744
License
MIT
Repository
github
Last release
6 years ago

start-server-webpack-plugin

Automatically start your server once Webpack's build completes + handle hot reloading (HMR)

travis build version downloads MIT License

Installation

$ npm install --save-dev start-server-webpack-plugin

Usage

In webpack.config.server.babel.js:

import StartServerPlugin from "start-server-webpack-plugin";

export default {
  ...
  plugins: [
    ...
    // Only use this in DEVELOPMENT
    new StartServerPlugin({
      // name of the entry to run, defaults to 'main'
      entryName: 'server',
      // any arguments to nodejs when running the entry, this one allows debugging
      nodeArgs: ['--inspect-brk'],
      // any arguments to pass to the script
      args: ['scriptArgument1', 'scriptArgument2'],
      // Allow typing 'rs' to restart the server. default: only if NODE_ENV is 'development'
      restartable: true | false,
      // Only run the server once (default: false)
      once: false | true,
    }),
    ...
  ],
  ...
}

The entryName argument defaults to "main", which is the name Webpack uses if you use the string or array versions of the entry option.

You can use nodeArgs and args to pass arguments to node and your script, respectively. For example, you can use this to use the node debugger.

To use Hot Module Reloading with your server code, set Webpack to "hot" and "watch" modes. This plugin appends some code to the end of the entry so that it can handle HMR and restarts; no need to add any of the webpack/hot modules.

Upgrading from v2

  • Remove the name option and define entryName if it's not just "main"
  • Remove any hot reloading additions

License

MIT License 2016-2018 © Eric Clemmons

@asep.setiawan/react-kit@deity/falcon-clienteatpro-ssr@wowotou/cli@zelz/crankandg-m@infinitebrahmanuniverse/nolb-start@everything-registry/sub-chunk-2820l-razzlelei-ssr@leijingdao/razzleneutrino-middleware-start-serveraws-demo-s3@asep.setiawan/react-tool-kit@alpacka/core@alpacka/plugin-lambda@alpacka/runtime-lambdaautomagical@atlantis-lab/server-scripts@axilis/node-scriptscaydebsl-buildbsl-service@bjulia/razzlebuild-graphqlcardero-x-razzleolymp-cliolympolymp-appolymp-webpackolymp-webpack-lambdaradish-serverooo-appreact-ssr-scriptsrazzle-babel-7react-kitsry-buildry-servicexin-react-scriptsumeboshi-config-staticvue-starter-servicevuniversalyeti-scriptswebpack-config-lagtapestry-literezarn-razzlesku-for-testingspracketreaction-buildrazzle-rnrazzle-temprazzle-zhc@coreyleelarson/universal-react-scriptscreate-frontend@dotdevru/react-ssr-scriptscreate-frontend-temporary@dlab/cra-universal@doyakovlev/arui-scriptsdacedace-lite@activity-maker/component-scripts@apployees-nx/webserver@aquestsrl/create-app-cli@enginite/shinobi@frendyguo/rift-scriptsarui-scripts-akitovdpdk-razzle@finfe/react-kitschard-scripts@loveholidays/razzlefullstack-system@neutrinojs/start-server@nice-js/preset-node@monstrs/server-scripts@optimistdigital/create-frontend@proerd/nextpress@reactant/web-isomorphic@tangible/react-builder@terse/webpack@refract-cms/cli@regime/static@reslow/cli@siteone/builder@smartvokat/launchpad@vaporweb/appmelkornms-razzleendify-testmmm-scriptsmnamna.cli@wpefintech/react-tool-kitmonorepo-nest-apiex-hot-type-press@zalando-sunrise/backstage-cli
3.0.0-rc3

6 years ago

3.0.0-rc2

6 years ago

3.0.0-rc1

6 years ago

2.2.5

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

8 years ago

2.0.0

8 years ago