How to use the @webpack-blocks/webpack.env function in @webpack-blocks/webpack

To help you get started, we’ve selected a few @webpack-blocks/webpack 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 JasperFx / jasper / src / Jasper.Diagnostics / webpack.config.js View on Github external
exclude: /node_modules/
  }),
  env('development', [
    devServer([
      `webpack-dev-server/client?http://localhost:${WEBPACK_DEV_PORT}`,
      'webpack/hot/only-dev-server'
    ]),
    devServer.proxy({
      '*': { target: `http://localhost:${DEV_PORT}` }
    }),
    devServer.reactHot({
      exclude: /node_modules/
    }),
    sourceMaps()
  ]),
  env('production', [
    addPlugins([
      // Try to dedupe duplicated modules, if any:
      new webpack.optimize.DedupePlugin(),
      // Minify the code.
      new webpack.optimize.UglifyJsPlugin({
        compress: {
          screw_ie8: true, // React doesn't support IE8
          warnings: false
        },
        mangle: {
          screw_ie8: true
        },
        output: {
          comments: false,
          screw_ie8: true
        }
github JasperFx / jasper / src / Jasper.Diagnostics / webpack.config.js View on Github external
}),
  cssLoader(),
  addPlugins([
    // This helps ensure the builds are consistent if source hasn't changed:
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify(ENV)
      }
    }),
    new ManifestPlugin()
  ]),
  babel({
    exclude: /node_modules/
  }),
  env('development', [
    devServer([
      `webpack-dev-server/client?http://localhost:${WEBPACK_DEV_PORT}`,
      'webpack/hot/only-dev-server'
    ]),
    devServer.proxy({
      '*': { target: `http://localhost:${DEV_PORT}` }
    }),
    devServer.reactHot({
      exclude: /node_modules/
    }),
    sourceMaps()
  ]),
  env('production', [
    addPlugins([
      // Try to dedupe duplicated modules, if any:
      new webpack.optimize.DedupePlugin(),
github cyclejs-community / one-fits-all / configs / webpack.config.js View on Github external
compress: {
                        warnings: false
                    }
                }
            }),
            addPlugins([
                new CleanWebpackPlugin([appPath('build')], {
                    root: process.cwd()
                }),
                new CopyWebpackPlugin([{ from: 'public', to: '' }])
            ])
        ])
    ]),
    userConfig,
    createConfig([
        env('test', [
            customConfig({
                target: 'node',
                externals: [nodeExternals()],
                output: {
                    // use absolute paths in sourcemaps (important for debugging via IDE)
                    devtoolModuleFilenameTemplate: '[absolute-resource-path]',
                    devtoolFallbackModuleFilenameTemplate:
                        '[absolute-resource-path]?[hash]'
                },
                module: {
                    rules: [
                        {
                            test: /\.(jsx?|tsx?)/,
                            include: packageJson.nyc.include.map(p =>
                                path.resolve(appPath(p))
                            ),
github diegohaz / webpack-blocks-split-vendor / src / index.js View on Github external
name = 'vendor',
    test = /\.js$/,
    exclude,
  } = typeof options === 'object' ? options : ({ name: options }: Options)

  return group([
    setOutput({
      filename: '[name].js',
    }),
    addPlugins([
      new webpack.optimize.CommonsChunkPlugin({
        name,
        minChunks: ({ resource }) => isVendor(resource, test, exclude),
      }),
    ]),
    env('production', [
      setOutput({
        filename: '[name].[chunkhash].js',
      }),
      addPlugins([
        new WebpackMd5Hash(),
      ]),
    ]),
  ])
}
github cyclejs-community / one-fits-all / configs / webpack.config.js View on Github external
new HtmlWebpackHarddiskPlugin({
                outputPath: appPath('public')
            }),
            new webpack.ProvidePlugin({
                Snabbdom: 'snabbdom-pragma'
            })
        ]),
        env('development', [
            devServer({
                port: PORT,
                contentBase: appPath('public')
            }),
            sourceMaps(),
            addPlugins([new webpack.NamedModulesPlugin()])
        ]),
        env('production', [
            uglify({
                parallel: true,
                cache: true,
                uglifyOptions: {
                    compress: {
                        warnings: false
                    }
                }
            }),
            addPlugins([
                new CleanWebpackPlugin([appPath('build')], {
                    root: process.cwd()
                }),
                new CopyWebpackPlugin([{ from: 'public', to: '' }])
            ])
        ])
github cyclejs-community / one-fits-all / configs / webpack.config.js View on Github external
addPlugins([
            new HtmlWebpackPlugin({
                template: './index.ejs',
                alwaysWriteToDisk: true,
                inject: true,
                favicon: 'public/favicon.png',
                hash: true
            }),
            new HtmlWebpackHarddiskPlugin({
                outputPath: appPath('public')
            }),
            new webpack.ProvidePlugin({
                Snabbdom: 'snabbdom-pragma'
            })
        ]),
        env('development', [
            devServer({
                port: PORT,
                contentBase: appPath('public')
            }),
            sourceMaps(),
            addPlugins([new webpack.NamedModulesPlugin()])
        ]),
        env('production', [
            uglify({
                parallel: true,
                cache: true,
                uglifyOptions: {
                    compress: {
                        warnings: false
                    }
                }