How to use the webpack-config-utils.getIfUtils function in webpack-config-utils

To help you get started, weโ€™ve selected a few webpack-config-utils 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 arogozine / LinqToTypeScript / config / rollup.config.js View on Github external
import replace from 'rollup-plugin-replace'
import { uglify } from 'rollup-plugin-uglify'
import { terser } from 'rollup-plugin-terser'
import { getIfUtils, removeEmpty } from 'webpack-config-utils'

import { peerDependencies } from '../package.json'

/**
 * @typedef {import('./types').RollupConfig} Config
 */
/**
 * @typedef {import('./types').RollupPlugin} Plugin
 */

const env = process.env.NODE_ENV || 'development'
const { ifProduction } = getIfUtils(env)

const ROOT = resolve(__dirname, '..')
const DIST = resolve(ROOT, 'dist') // 

/**
 * Object literals are open-ended for js checking, so we need to be explicit
 * @type {{entry:{esm2015: string, cjs: string},bundles:string}}
 */
const PATHS = {
  entry: {
    cjs: resolve(DIST, 'cjs'),
    esm2015: resolve(DIST, 'esm2015'),
  },
  bundles: resolve(DIST, 'bundles'),
}
github lore / lore / upgrade-guides / v0.11-v0.12 / es5 / webpack.config.js View on Github external
module.exports = function(env) {
  var { ifProduction, ifNotProduction } = getIfUtils(env);

  return {
    devtool: ifProduction('source-map', 'eval'),
    entry: {
      main: './index.js',
      vendor: [
        'react',
        'react-dom',
        'react-router'
      ]
    },
    output: {
      filename: ifProduction(
        'bundle.[name].[chunkhash].js',
        'bundle.[name].js'
      ),
github lore / lore / examples / normalization / webpack.config.js View on Github external
module.exports = function(env) {
  var { ifProduction, ifNotProduction } = getIfUtils(env);

  return {
    devtool: ifProduction('source-map', 'eval'),
    entry: {
      main: './index.js',
      vendor: [
        'react',
        'react-dom',
        'react-router'
      ]
    },
    output: {
      filename: ifProduction(
        'bundle.[name].[chunkhash].js',
        'bundle.[name].js'
      ),
github lore / lore / examples / forms-material-ui / webpack.config.js View on Github external
module.exports = function(env) {
  var { ifProduction, ifNotProduction } = getIfUtils(env);

  return {
    devtool: ifProduction('source-map', 'eval'),
    entry: {
      main: './index.js',
      vendor: [
        'react',
        'react-dom',
        'react-router'
      ],
      material: [
        'material-ui',
        'material-ui/svg-icons',
        'material-ui/svg-icons/content/add',
        'material-ui/List',
        'material-ui/svg-icons/navigation/more-vert',
github lore / lore / packages / lore-generate-new / templates / es5 / webpack.config.js View on Github external
module.exports = function(env) {
  var { ifProduction, ifNotProduction } = getIfUtils(env);

  return {
    devtool: ifProduction('source-map', 'eval'),
    entry: {
      main: './index.js',
      vendor: [
        'react',
        'react-dom',
        'react-router'
      ]
    },
    output: {
      filename: ifProduction(
        'bundle.[name].[chunkhash].js',
        'bundle.[name].js'
      ),
github lore / lore / examples / forms-bootstrap / webpack.config.js View on Github external
module.exports = function(env) {
  var { ifProduction, ifNotProduction } = getIfUtils(env);

  return {
    devtool: ifProduction('source-map', 'eval'),
    entry: {
      main: './index.js',
      vendor: [
        'react',
        'react-dom',
        'react-router'
      ]
    },
    output: {
      filename: ifProduction(
        'bundle.[name].[chunkhash].js',
        'bundle.[name].js'
      ),
github pixeloven / pixeloven / packages / pixeloven-webpack / config / src / helpers / client.ts View on Github external
export function getEntry(environment: string, publicPath: string): Entry {
    const { ifDevelopment } = getIfUtils(environment);
    const hmrPath = path.normalize(`/${publicPath}/__webpack_hmr`);
    return {
        main: removeEmpty([
            require.resolve("@babel/polyfill"),
            ifDevelopment(
                `webpack-hot-middleware/client?path=${hmrPath}`,
                undefined,
            ),
            resolvePath("src/client/index.tsx"),
        ]),
    }
}
github decentralized-identity / element / packages / element-core / config / rollup.config.js View on Github external
import pkg from '../package.json'
const {
  pascalCase,
  normalizePackageName,
  getOutputFileName,
} = require('./helpers')

/**
 * @typedef {import('./types').RollupConfig} Config
 */
/**
 * @typedef {import('./types').RollupPlugin} Plugin
 */

const env = process.env.NODE_ENV || 'development'
const { ifProduction } = getIfUtils(env)

const LIB_NAME = pascalCase(normalizePackageName(pkg.name))
const ROOT = resolve(__dirname, '..')
const DIST = resolve(ROOT, 'dist')

/**
 * Object literals are open-ended for js checking, so we need to be explicit
 * @type {{entry:{esm5: string, esm2015: string},bundles:string}}
 */
const PATHS = {
  entry: {
    esm5: resolve(DIST, 'esm5'),
    esm2015: resolve(DIST, 'esm2015'),
  },
  bundles: resolve(DIST, 'bundles'),
}
github Hotell / typescript-lib-starter / config / rollup.config.js View on Github external
import pkg from '../package.json'
const {
  pascalCase,
  normalizePackageName,
  getOutputFileName,
} = require('./helpers')

/**
 * @typedef {import('./types').RollupConfig} Config
 */
/**
 * @typedef {import('./types').RollupPlugin} Plugin
 */

const env = process.env.NODE_ENV || 'development'
const { ifProduction } = getIfUtils(env)

const LIB_NAME = pascalCase(normalizePackageName(pkg.name))
const ROOT = resolve(__dirname, '..')
const DIST = resolve(ROOT, 'dist')

/**
 * @type {{entry:{esm5: string, esm2015: string},bundles:string}}
 */
const PATHS = {
  entry: {
    esm5: resolve(DIST, 'esm5'),
    esm2015: resolve(DIST, 'esm2015'),
  },
  bundles: resolve(DIST, 'bundles'),
}
github Hotell / rex-tils / config / rollup.config.js View on Github external
import pkg from '../package.json'
const {
  pascalCase,
  normalizePackageName,
  getOutputFileName,
} = require('./helpers')

/**
 * @typedef {import('./types').RollupConfig} Config
 */
/**
 * @typedef {import('./types').RollupPlugin} Plugin
 */

const env = process.env.NODE_ENV || 'development'
const { ifProduction } = getIfUtils(env)

const LIB_NAME = pascalCase(normalizePackageName(pkg.name))
const ROOT = resolve(__dirname, '..')
const DIST = resolve(ROOT, 'dist')

/**
 * Object literals are open-ended for js checking, so we need to be explicit
 * @type {{entry:{esm5: string, esm2015: string},bundles:string}}
 */
const PATHS = {
  entry: {
    esm5: resolve(DIST, 'esm5'),
    esm2015: resolve(DIST, 'esm2015'),
  },
  bundles: resolve(DIST, 'bundles'),
}

webpack-config-utils

Utilities to help your webpack config be easier to read

MIT
Latest version published 6 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages