New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

next-custom-server

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-custom-server

Next.js plugin enabling custom servers to be processed by Webpack.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

🛸 next-custom-server

Next.js plugin enabling custom servers to be processed by Webpack.

🔗 Installation

Install via npm:

npm install next-custom-server --save

🛠️ Usage

With the release of Next.js 5.0, universal Webpack makes the consistent use of loaders and code transformations in your Next.js application possible! To enjoy these benefits in your custom server entry point (and maintain a consistent syntax between your client and server), apply this plugin to your next.config.js, like so:

const withCustomServer = require('next-custom-server');

module.exports = withCustomServer({
    serverEntry: './path/to/custom/server.js' // Optional, defaults to <NEXT_DIR>/server*
});

Then, in your server.js, export a function that accepts a Next.js application as its argument:

export default nextApp => {
    // Do fancy custom server stuff here!
    nextApp.start(3000);
};

Finally, update your package.json scripts:

{
    "scripts": {
        "dev": "next-custom-server dev",
        "build": "next build",
        "start": "next-custom-server start"
    }
}

CLI

next-custom-server [dir]

Replaces `next dev`. Starts the application in development mode (hot-code
reloading, error reporting, etc).

Commands:
  next-custom-server dev [dir]    Replaces `next dev`. Starts the application in
                                  development mode (hot-code reloading, error
                                  reporting, etc).                     [default]
  next-custom-server start [dir]  Replaces `next start`. Starts the application
                                  in production mode.
                                  The application should be compiled with `next
                                  build` first.

Options:
  --version       Show version number                                  [boolean]
  --help          Show help                                            [boolean]
  --dir           The location of your Next project               [default: "."]
  --staticMarkup  Use renderToStaticMarkup() instead of renderToString().
                                                                [default: false]
  --quiet         Hide error messages containing server information.
                                                                [default: false]

❤️ Contributing

Please see contributing.md

⚖️ License

The MIT License

Keywords

next

FAQs

Package last updated on 12 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts