How to use sitemap-webpack-plugin - 8 common examples

To help you get started, we’ve selected a few sitemap-webpack-plugin 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 runelite / runelite.net / config-overrides.js View on Github external
config.plugins.push(
    new PrerenderSPAPlugin({
      // Required - The path to the webpack-outputted app to prerender.
      staticDir: path.join(__dirname, 'build'),
      // Required - Routes to render.
      routes: routes.map(({ path }) => path),
      // Make prerendering more stable
      renderer: new Renderer({
        maxConcurrentRoutes: 1,
        renderAfterTime: 1000
      })
    })
  )

  config.plugins.push(
    new SitemapPlugin(hero.url, routes, {
      lastMod: true,
      changeFreq: 'weekly'
    })
  )

  config.plugins.push(
    new HtmlWebpackPlugin({
      feed: {
        url: hero.url,
        title: hero.title,
        subtitle: hero.description,
        entries: posts.map(feedMapper).reverse()
      },
      template: 'public/atom.html',
      filename: 'atom.xml',
      inject: false,
github jerryjappinen / bellevue / build / webpack.prod.conf.js View on Github external
}

// Generate manifest.json if set in config
if (manifestConfig) {
  webpackConfig.plugins.push(new WebappManifestPlugin(manifestConfig))
}

// Generate robots.txt
if (robotsTxtConfig && robotsTxtConfig.host && robotsTxtConfig.policy) {
  webpackConfig.plugins.push(new RobotstxtPlugin(robotsTxtConfig))
}

// Generate sitemap.xml
if (sitemapConfig && sitemapConfig.base) {
  webpackConfig.plugins.push(
    new SitemapPlugin(
      sitemapConfig.base,
      sitemapConfig.paths,
      sitemapConfig.options
    )
  )
}

if (config.build.productionGzip) {
  const CompressionWebpackPlugin = require('compression-webpack-plugin')

  webpackConfig.plugins.push(
    new CompressionWebpackPlugin({
      asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: new RegExp(
        '\\.(' +
github Shyam-Chen / React-Starter / webpack.config.js View on Github external
]),
    !prod && new webpack.HotModuleReplacementPlugin(),
    prod && new webpack.optimize.AggressiveSplittingPlugin(),
    // prod && new GenerateSW({
    //   skipWaiting: true,
    //   clientsClaim: true,
    //   runtimeCaching: [{
    //     urlPattern: new RegExp(env.SITE_URL),
    //     handler: 'staleWhileRevalidate',
    //   }],
    //   navigateFallback: '/',
    //   navigateFallbackWhitelist: [/^(?!\/__).*/],
    //   cacheId: pkg.name,
    // }),
    prod && new RobotstxtPlugin(),
    prod && new SitemapPlugin(env.SITE_URL, [{ path: '/' }]),
  ].filter(Boolean),
  optimization: {
    splitChunks: {
      cacheGroups: {
        common: {
          name: 'common',
          chunks: 'initial',
          minChunks: 2,
        },
        vendor: {
          test: /[\\/]node_modules[\\/]/,
          name: 'vendor',
          chunks: 'all',
        },
      },
    },
github ericalli / static-site-boilerplate / config / webpack.plugins.js View on Github external
if (filename !== '404.html') {
    paths.push(filename);
  }

  return new HTMLWebpackPlugin({
    filename,
    template: path.join(config.root, config.paths.src, filename),
    meta: {
      viewport: config.viewport,
    },
  });
});

// Sitemap
const sitemap = new SitemapPlugin(config.site_url, paths, {
  priority: 1.0,
  lastmodrealtime: true,
});

// Favicons
const favicons = new WebappWebpackPlugin({
  logo: config.favicon,
  prefix: 'images/favicons/',
  favicons: {
    appName: config.site_name,
    appDescription: config.site_description,
    developerName: null,
    developerURL: null,
    icons: {
      android: true,
      appleIcon: true,
github tomjschuster / sequelize-ui / webpack.config.js View on Github external
name: '/fonts/[name].[ext]',
          mimetype: 'application/font-otf',
          outputPath: 'static'
        }
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: 'src/index.html',
      filename: 'index.html'
    }),
    new MiniCssExtractPlugin({ filename: 'static/[name].[hash].css' }),
    new CopyWebpackPlugin([{ from: 'assets', to: './static' }]),
    new RobotstxtPlugin(),
    new SitemapPlugin('https://sequelizeui.app', ['/'], { lastMod: true })
  ]
}
github wxsms / uiv / build / utils.js View on Github external
exports.generateRenderPlugins = () => {
  let paths = getDocumentRoutes()
  let distPath = path.join(__dirname, './../dist-docs')
  return [
    new PrerenderSpaPlugin({
        staticDir: distPath,
        routes: paths,
        renderer: new Renderer({
          maxConcurrentRoutes: 5
        })
      }
    ),
    new SitemapPlugin(
      'https://uiv.wxsm.space',
      paths.map(path => path === '/' ? path : path + '/'),
      {
        changeFreq: 'weekly'
      }
    )
  ]
}
github wxsms / blog / build / utils.js View on Github external
routes: staticPaths,
        renderer: new Renderer({
          maxConcurrentRoutes: 5
        })
      }
    ),
    new PrerenderSpaPlugin({
        staticDir: distPath,
        routes: ajaxPaths,
        renderer: new Renderer({
          renderAfterElementExists: '#post-content',
          maxConcurrentRoutes: 5
        })
      }
    ),
    new SitemapPlugin('https://wxsm.space', [].concat(staticPaths, ajaxPaths), {
      skipGzip: true,
      changeFreq: 'weekly'
    })
  ]
}
github Mrtenz / FindETH / webpack / production.ts View on Github external
persistentCache: true,
      title: 'FindETH',
      icons: {
        favicons: false
      }
    }),
    new CspHtmlWebpackPlugin({
      'default-src': `'none'`,
      'script-src': `'self' https://analytics.mycryptoapi.com`,
      'style-src': `'unsafe-inline'`,
      'img-src': `'self' data: https://analytics.mycryptoapi.com`,
      'font-src': `'self'`,
      'connect-src': `https://api.mycryptoapi.com/eth https://mainnet.infura.io https://api.etherscan.io`,
      'frame-src': `'self' https://connect.trezor.io/`
    }),
    new SitemapWebpackPlugin('https://findeth.io', SITEMAP_PATHS),
    new RobotsPlugin({
      policy: [
        {
          userAgent: '*',
          allow: '/',
          disallow: '/search'
        }
      ],
      sitemap: 'https://findeth.io/sitemap.xml'
    })
  ]
};

export default smart(common, configuration);

sitemap-webpack-plugin

Webpack plugin to generate a sitemap.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular sitemap-webpack-plugin functions