How to use @s-ui/bundler - 10 common examples

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
.parse(process.argv)

const entryPointsComponents = program.linkAll ? componentsFullPath(PWD) : []

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)
    }
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]
github SUI-Components / sui / packages / sui-widget-embedder / compiler / development.js View on Github external
module.exports = ({address, page, port}) =>
  webpack({
    ...devConfig,
    context: path.resolve(process.cwd(), 'pages', page),
    entry: [`./index.js`],
    output: {
      path: '/',
      publicPath: `http://${address}:${port}/`,
      filename: 'bundle.js',
      jsonpFunction: `webpackJsonp-${page}-dev`
    },
    plugins: pipe(removePlugin('HtmlWebpackPlugin'))(devConfig.plugins)
  })
github SUI-Components / sui / packages / sui-widget-embedder / compiler / production.js View on Github external
)

  const entry = {app: MAIN_ENTRY_POINT}
  if (config.vendor) {
    entry['vendor'] = config.vendor
  }
  return webpack({
    ...prodConfig,
    context: path.resolve(process.cwd(), 'pages', page),
    resolve: {
      ...prodConfig.resolve,
      alias: globalConfig.alias
    },
    entry,
    output: {
      ...prodConfig.output,
      path: path.resolve(process.cwd(), 'public', page),
      publicPath: remoteCdn
        ? `${remoteCdn}/${page}/`
        : prodConfig.output.publicPath,
      jsonpFunction: `webpackJsonp-${page}`
    },
    optimization: {
      ...prodConfig.optimization,
      minimizer: [
        uglifyJsPlugin,
        new OptimizeCSSAssetsPlugin({
          cssProcessorOptions: {
            zindex: false
          }
        })
      ]
github SUI-Components / sui / packages / sui-widget-embedder / compiler / production.js View on Github external
entry['vendor'] = config.vendor
  }
  return webpack({
    ...prodConfig,
    context: path.resolve(process.cwd(), 'pages', page),
    resolve: {
      ...prodConfig.resolve,
      alias: globalConfig.alias
    },
    entry,
    output: {
      ...prodConfig.output,
      path: path.resolve(process.cwd(), 'public', page),
      publicPath: remoteCdn
        ? `${remoteCdn}/${page}/`
        : prodConfig.output.publicPath,
      jsonpFunction: `webpackJsonp-${page}`
    },
    optimization: {
      ...prodConfig.optimization,
      minimizer: [
        uglifyJsPlugin,
        new OptimizeCSSAssetsPlugin({
          cssProcessorOptions: {
            zindex: false
          }
        })
      ]
    },
    plugins: pipe(
      removePlugin('HtmlWebpackPlugin'),
      removePlugin('ScriptExtHtmlWebpackPlugin'),
github SUI-Components / sui / packages / sui-widget-embedder / compiler / production.js View on Github external
context: path.resolve(process.cwd(), 'pages', page),
    resolve: {
      ...prodConfig.resolve,
      alias: globalConfig.alias
    },
    entry,
    output: {
      ...prodConfig.output,
      path: path.resolve(process.cwd(), 'public', page),
      publicPath: remoteCdn
        ? `${remoteCdn}/${page}/`
        : prodConfig.output.publicPath,
      jsonpFunction: `webpackJsonp-${page}`
    },
    optimization: {
      ...prodConfig.optimization,
      minimizer: [
        uglifyJsPlugin,
        new OptimizeCSSAssetsPlugin({
          cssProcessorOptions: {
            zindex: false
          }
        })
      ]
    },
    plugins: pipe(
      removePlugin('HtmlWebpackPlugin'),
      removePlugin('ScriptExtHtmlWebpackPlugin'),
      removePlugin('PreloadWebpackPlugin')
    )(prodConfig.plugins)
  })
}
github SUI-Components / sui / packages / sui-widget-embedder / compiler / production.js View on Github external
optimization: {
      ...prodConfig.optimization,
      minimizer: [
        uglifyJsPlugin,
        new OptimizeCSSAssetsPlugin({
          cssProcessorOptions: {
            zindex: false
          }
        })
      ]
    },
    plugins: pipe(
      removePlugin('HtmlWebpackPlugin'),
      removePlugin('ScriptExtHtmlWebpackPlugin'),
      removePlugin('PreloadWebpackPlugin')
    )(prodConfig.plugins)
  })
}
github SUI-Components / sui / packages / sui-widget-embedder / compiler / production.js View on Github external
module.exports = ({page, remoteCdn, globalConfig = {}}) => {
  const config = requireOrDefault(
    path.resolve(process.cwd(), 'pages', page, 'package')
  )

  const entry = {app: MAIN_ENTRY_POINT}
  if (config.vendor) {
    entry['vendor'] = config.vendor
  }
  return webpack({
    ...prodConfig,
    context: path.resolve(process.cwd(), 'pages', page),
    resolve: {
      ...prodConfig.resolve,
      alias: globalConfig.alias
    },
    entry,
    output: {
      ...prodConfig.output,
      path: path.resolve(process.cwd(), 'public', page),
      publicPath: remoteCdn
        ? `${remoteCdn}/${page}/`
        : prodConfig.output.publicPath,
      jsonpFunction: `webpackJsonp-${page}`
    },
    optimization: {
      ...prodConfig.optimization,
      minimizer: [
        uglifyJsPlugin,
        new OptimizeCSSAssetsPlugin({
github SUI-Components / sui / packages / sui-ssr / compiler / server.js View on Github external
module.exports = ({outputPath}) =>
  webpack({
    ...serverConfig,
    entry: path.join(__dirname, '..', 'server'),
    output: {
      ...serverConfig.output,
      path: outputPath,
      chunkFilename: '[name].js',
      filename: 'index.js'
    },
    externals: undefined,
    resolve: {
      ...serverConfig.resolve,
      modules: [
        path.join(__dirname, '..', 'server'),
        path.join(__dirname, '..', 'node_modules'),
        path.join(process.cwd(), 'src'),
        path.join(process.cwd(), 'node_modules'),
        'node_modules'
      ]
    }
  })