Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@futuregroup/webpack-custom-blocks

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@futuregroup/webpack-custom-blocks

A set of well-thought 📦webpack-blocks for real-world projects

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by1200%
Maintainers
2
Weekly downloads
 
Created
Source

webpack-custom-blocks · npm

A set of well-thought 📦webpack-blocks for real-world projects.

Table of Content

API

setEnv([options])

Sets environmental variables to process.env and EnvironmentPlugin.

Arguments

  • [options] (Object): Any enumerable properties.

Example

setEnv({
    NODE_ENV: 'development',
    HOT: true,
    // Any other variables.
})

watch([options])

Watch mode.

Arguments

  • [options] (Object): See watchOptions for available properties.

reactHotServer([options])

Built on top of webpack-dev-server and react-hot-loader@3.

Arguments

  • [options] (Object): Available properties:
    • [host] (String): Defaults to localhost.
    • [port] (Number|String): Defaults to 8080.
    • [publicPath] (String|Number): Defaults to '/'. The final output.publicPath will be http://${host}:${port}${path}.
    • [names] (Array): Defaults to []. If entry is an object, only chunks with these names will be extended with react-hot-loader.
    • [...rest] (*): Any valid devServer properties.

Example

const {createConfig, entryPoint, setOutput, customConfig} = require('@webpack-blocks/webpack2');
const {setEnv, reactHotServer, babelLoader} = require('@futuregroup/webpack-custom-blocks');

module.exports = createConfig([
    setEnv({
        NODE_ENV: 'development',
    }),

    entryPoint({
        all: './src/index.js',
    }),

    setOutput({
        filename: 'js/[name].js',
    }),
    
    reactHotServer({
        port: 3000,
        publicPath: '/build/',
        names: ['all'],
        headers: {
            'Access-Control-Allow-Origin': '*',
        },
    }),

    customConfig({
        target: 'web',
        devtool: 'eval',
    }),

    babelLoader({
        exclude: /node_modules/,
        babelOptions: {
            presets: ['latest', 'react'],
              plugins: ['react-hot-loader/babel'],
        },
    }),
]);

babelLoader([options])

Built on top of babel-loader.

Arguments

  • [options] (Object): Available properties:
    • [test] (*)
    • [fileType] (*): Defaults to application/javascript. If test is also set, then it adds a new fileType, else uses it as an existing one.
    • [babelOptions] (Object): babel-loader options.
    • [...rest] (*): Rule options.

cssLoader([options])

Built on top of style-loader and css-loader.

Arguments

  • [options] (Object): Available properties:
    • [test] (*)
    • [fileType] (*): Defaults to text/css. If test is also set, then it adds a new fileType, else uses it as an existing one.
    • [loaders] (Array): Defaults to []. Additional loaders that go after css-loader.
    • [styleOptions] (Object): style-loader options.
    • [cssOptions] (Object): css-loader options.
    • [...rest] (*): Rule options.

stylusLoader([options])

Built on top of stylus-loader and extract-loader.

Arguments

  • [options] (Object): Available properties:
    • [test] (*): Defaults to /\.(styl|stylus)$/.
    • [fileType] (*): Defaults to text/x-stylus.
    • [fileOptions] (Object)
    • [extractOptions] (Object)
    • [cssOptions] (Object)
    • [stylusOptions] (Object)
    • [...rest] (*): Rule options.

pugLoader([options])

Build on top of pug-html-loader.

Arguments

  • [options] (Object): Available properties:
    • [test] (*): Defaults to /\.(pug|jade)$/.
    • [fileType] (*): Defaults to text/x-pug.
    • [fileOptions] (Object)
    • [pugOptions] (Object)
    • [...rest] (*): Rule options.

imageLoader([options])

Build on top of image-webpack-loader.

Arguments

  • [options] (Object): Available properties:
    • [test] (*)
    • [fileType] (*): Defaults to image.
    • [fileOptions] (Object)
    • [imageOptions] (Object)
    • [...rest] (*): Rule options.

fontLoader([options])

Arguments

  • [options] (Object): Available properties:
    • [test] (*)
    • [fileType] (*): Defaults to application/font.
    • [fileOptions] (Object)
    • [...rest] (*): Rule options.

Keywords

FAQs

Package last updated on 07 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc