How to use the @s-ui/bundler/webpack.config.dev.resolve function in @s-ui/bundler

To help you get started, we’ve selected a few @s-ui/bundler 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 SUI-Components / sui / packages / sui-studio / bin / sui-studio-dev.js View on Github external
const [componentID] = program.args
const [category, component] = componentID.split('/')

if (!category || !component) {
  console.log('The correct command is $ sui-studio dev [category]/[component]')
}

const studioDevConfig = {
  ...config,
  context: path.join(__dirname, '..', 'workbench', 'src'),
  plugins: [
    ...config.plugins,
    new webpack.DefinePlugin({__COMPONENT_ID__: JSON.stringify(componentID)})
  ],
  resolve: {
    ...config.resolve,
    alias: {
      ...config.resolve.alias,
      component: path.join(PWD, 'components', category, component, 'src'),
      package: path.join(
        PWD,
        'components',
        category,
        component,
        'package.json'
      ),
      demo: path.join(PWD, 'demo', category, component)
    }
  }
}

startDevServer({
github SUI-Components / sui / packages / sui-studio / bin / sui-studio-dev.js View on Github external
if (!category || !component) {
  console.log('The correct command is $ sui-studio dev [category]/[component]')
}

const studioDevConfig = {
  ...config,
  context: path.join(__dirname, '..', 'workbench', 'src'),
  plugins: [
    ...config.plugins,
    new webpack.DefinePlugin({__COMPONENT_ID__: JSON.stringify(componentID)})
  ],
  resolve: {
    ...config.resolve,
    alias: {
      ...config.resolve.alias,
      component: path.join(PWD, 'components', category, component, 'src'),
      package: path.join(
        PWD,
        'components',
        category,
        component,
        'package.json'
      ),
      demo: path.join(PWD, 'demo', category, component)
    }
  }
}

startDevServer({
  config: studioDevConfig,
  packagesToLink: [...entryPointsComponents, ...program.linkPackage]