How to use the next-compose-plugins.withPlugins function in next-compose-plugins

To help you get started, we’ve selected a few next-compose-plugins examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hanford / next-offline / tests / next.config.js View on Github external
"dir": "ltr",
  "lang": "en",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": "64x64 32x32 24x24 16x16",
      "type": "image/x-icon"
    }
  ],
  "start_url": "/",
  "display": "standalone",
  "theme_color": "#ffffff",
  "background_color": "#ffffff"
}

module.exports = withPlugins([
  [withManifest({ manifest })],
  [withOffline, { dontAutoRegisterSw: true }]
])
github atherosai / next-react-graphql-apollo-hooks / next.config.js View on Github external
if (NODE_ENV === 'development') {
      enhancedConfig.devtool = 'cheap-module-source-map';
    }

    enhancedConfig.resolve.extensions = config.resolve.extensions.concat([
      '.ts',
      '.tsx',
    ]);

    return config;
  },
};

const config = withPlugins(
  [
    [
      sass,
      {
        cssModules: true,
        cssLoaderOptions: {
          importLoaders: 1,
          localIdentName: '[local]___[hash:base64:5]',
        },
      },
    ],
    graphql,
    images,
    analyzer,
  ],
  nextConfig,
github rtCamp / wp-decoupled / next.config.js View on Github external
const { withPlugins } = require('next-compose-plugins');
const withOffline = require('next-offline');
const withSass = require( '@zeit/next-sass' );

const workBoxOptions = {
	generateSw: false,
	workboxOpts: {
		swDest: "./service-worker.js",
		swSrc: path.join(__dirname, "./service-worker.js"),
		globPatterns: ['static/**/*'],
		globDirectory: '.'
	}
};

module.exports = withPlugins([
    [withOffline( workBoxOptions ), { dontAutoRegisterSw: true }],
    [withCss(withSass({ target: "serverless" }))],
], {
    target: "serverless"
});

next-compose-plugins

Provides a cleaner API for enabling and configuring plugins for next.js

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis