How to use the @sanity/server.getWebpackBaseConfig function in @sanity/server

To help you get started, we’ve selected a few @sanity/server 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 sanity-io / sanity / packages / storybook / webpack.config.js View on Github external
module.exports = (storyWpConfig, configType) => {
  /* eslint-disable strict */

  'use strict'

  const sanityWpConfig = sanityServer.getWebpackBaseConfig({
    basePath: __dirname,
    commonChunkPlugin: false
  })

  sanityWpConfig.module = sanityWpConfig.module || {loaders: []}

  if (configType.toLowerCase() === 'development') {
    sanityWpConfig.module.loaders = sanityServer.applyStaticLoaderFix(sanityWpConfig, {
      httpHost: 'localhost',
      httpPort: 9001,
      staticPath: './static'
    })
  }

  return Object.assign({}, sanityWpConfig, storyWpConfig, {
    plugins: [].concat(storyWpConfig.plugins, sanityWpConfig.plugins || []),
github sanity-io / sanity / packages / @sanity / storybook / server / storyConfig / webpack.config.js View on Github external
module.exports = (storyWpConfig, configType) => {
  'use strict' // eslint-disable-line strict

  const sanityWpConfig = sanityServer.getWebpackBaseConfig({
    basePath: process.cwd(),
    commonChunkPlugin: false
  })

  let storybookConf = {}
  try {
    storybookConf = require(path.join(process.cwd(), 'sanity.json')).storybook
  } catch (err) {
    throw err
  }

  sanityWpConfig.module = sanityWpConfig.module || {loaders: []}

  if (configType === 'DEVELOPMENT') {
    sanityWpConfig.module.loaders = sanityServer.applyStaticLoaderFix(sanityWpConfig, {
      listen: Object.assign({