Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

razzle-plugin-device-specific-bundles

1.0.1 • Public • Published

razzle-plugin-device-specific-bundles

This package contains a plugin for creating device specific with Razzle.

See the example.

Usage in Razzle Projects

yarn add --dev razzle-plugin-device-specific-bundles

Using the plugin with the default options

// razzle.config.js
 
module.exports = {
  plugins: ['device-specific-bundles'],
};

With custom options:

// razzle.config.js
 
module.exports = {
  plugins: [
    {
      name: 'device-specific-bundles',
      options: {
        devices: ['desktop', 'mobile'],
        entry: 'ssr.js',
        alias: 'SSR'
      },
    },
  ],
};

Options

devices: array (defaults: ['desktop', 'mobile'])

An array with all the enabled devices

entry: string (defaults: ssr.js)

Entry point (relative to the src folder) of the server side rendering function file.

alias: string (defaults: SSR)

Alias used to include in the server (src/index.js) entry point the device specific server side rendering functions.

Considerations

Razzle comes with a react-dev-utils version that doesn't support webpack's multicompiler output, a newer version must be loaded using the selective version resolutions.

Keywords

none

Install

npm i razzle-plugin-device-specific-bundles

DownloadsWeekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

7.98 kB

Total Files

6

Last publish

Collaborators

  • avatar