Skip to content
This repository has been archived by the owner on Nov 22, 2019. It is now read-only.

madewithlove/webpack-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Madewithlove Webpack configuration

Build Status

Installation

Install the package

$ npm install madewithlove-webpack-config --save-dev

Usage

Basic usage

webpack.config.babel.js

import config from 'madewithlove-webpack-config';

export default config();

You can also fine-tune aspects of the configuration:

webpack.config.babel.js

import config from 'madewithlove-webpack-config';

export default config({
    react: true,
    sourcePath: 'src',
    outputPath: 'builds',
    enableRiskyOptimizations: true,
});

Advanced usage

webpack.config.babel.js

import config from 'madewithlove-webpack-config';

export default config().merge({
    module: {
        loaders: [
            // Append a loader
        ],
    }
    plugins: [
        // Append a plugin
    ],
});

Using templates

webpack.config.babel.js

import {factory} from 'madewithlove-webpack-config';

const template = (config, options, loaders, plugins) => {
    return config.merge({
        devtool: options.development ? 'foo' : 'bar',
        module: {
            loaders: [
                loaders.css,
                loaders.js,
                {
                    test: options.someExtraOption,
                }
            ],
        },
        plugins: [plugins.uglify]
    });
};

export default factory(template, {
    someExtraOption: 'foo',
});