All Projects β†’ bootstarted β†’ webpack-partial

bootstarted / webpack-partial

Licence: other
Partial webpack configuration.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webpack-partial

Baumeister
πŸ‘· The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (+388.57%)
Mutual labels:  webpack-configuration
plebpack
Webpack configuration for the common people.
Stars: ✭ 13 (-62.86%)
Mutual labels:  webpack-configuration
skeleton-loader
Loader module for webpack to execute your custom procedure. It works as your custom loader.
Stars: ✭ 19 (-45.71%)
Mutual labels:  webpack-configuration
Webpack Chain
A chaining API to generate and simplify the modification of Webpack configurations.
Stars: ✭ 2,821 (+7960%)
Mutual labels:  webpack-configuration
chunks-webpack-plugin
Create HTML files with entrypoints and chunks relations to serve your bundles
Stars: ✭ 22 (-37.14%)
Mutual labels:  webpack-configuration
webpack-config
Webpack 5 configuration for static projects...
Stars: ✭ 96 (+174.29%)
Mutual labels:  webpack-configuration
React Webpack4 Cook
πŸ’―The most powerful webpack4 tutorial in the universe
Stars: ✭ 152 (+334.29%)
Mutual labels:  webpack-configuration
config-loader
[DEPRECATED] A loader for webpack configuration files
Stars: ✭ 14 (-60%)
Mutual labels:  webpack-configuration
webpack-mix
Elegant wrapper around Webpack for more than 80% use cases.
Stars: ✭ 51 (+45.71%)
Mutual labels:  webpack-configuration
esri-webpack-babel
A bare bones example showing how to use the ArcGIS API for JavaScript in an application built with webpack and Babel to compile ES2015 modules.
Stars: ✭ 18 (-48.57%)
Mutual labels:  webpack-configuration
Wpk
a friendly, intuitive & intelligent CLI for webpack
Stars: ✭ 232 (+562.86%)
Mutual labels:  webpack-configuration
Frontend Webpack Boilerplate
Simple starter webpack 5 project template supporting SASS/PostCSS, Babel ES7, browser syncing, code linting. Easy project setup having multiple features and developer friendly tools.
Stars: ✭ 242 (+591.43%)
Mutual labels:  webpack-configuration
webpack-recipes
πŸ†˜ A collection of webpack configurations
Stars: ✭ 46 (+31.43%)
Mutual labels:  webpack-configuration
Gulp Webpack Starter
Gulp Webpack Starter - fast static website builder. The starter uses gulp toolkit and webpack bundler. Download to get an awesome development experience!
Stars: ✭ 199 (+468.57%)
Mutual labels:  webpack-configuration
babel-webpack-package-boilerplate
boilerplate for building an npm package using webpack, with next-gen javascript transpilation through babel
Stars: ✭ 23 (-34.29%)
Mutual labels:  webpack-configuration
Webpack Config Handbook
Minimum Webpack config handbook & examples
Stars: ✭ 165 (+371.43%)
Mutual labels:  webpack-configuration
vscode-exts
Visual Studio Code Extensions
Stars: ✭ 33 (-5.71%)
Mutual labels:  webpack-configuration
webpack-typescript-react
Webpack 5 boilerplate with support of most common loaders and modules (see tags and description)
Stars: ✭ 185 (+428.57%)
Mutual labels:  webpack-configuration
flowtip
A flexible, adaptable and easy to use tooltip positioning library.
Stars: ✭ 16 (-54.29%)
Mutual labels:  bootstart
django-manifest-loader
Simplifies webpack configuration with Django
Stars: ✭ 105 (+200%)
Mutual labels:  webpack-configuration

webpack-partial

Intelligently compose webpack configuration files.

build status coverage license version downloads

Usage

npm install --save webpack-partial

Making webpack configurations composable is tricky. So we provide several helpers to ease the composition process. Each helper is of the form (arg1, arg2, ..., webpackConfig). All functions are curried and the last argument is always a webpack configuration object allowing you to chain helpers together easily with compose (or flow).

Generally:

import compose from 'lodash/fp/compose';
import plugin from 'webpack-partial/plugin';
import StatsWebpackPlugin from 'stats-webpack-plugin';
import ExtractTextWebpackPlugin from 'extract-text-webpack-plugin';

const buildConfig = compose(
  plugin(new StatsWebpackPlugin()),
  plugin(new ExtractTextWebpackPlugin())
);

const config = buildConfig({/* webpack config here */});

But you can also use them individually if you need to:

import plugin from 'webpack-partial/plugin';
import StatsWebpackPlugin from 'stats-webpack-plugin';

const config = plugin(new StatsWebpackPlugin(), {/* webpack config here */});

The available helpers are:

  • entry
  • loader
  • output
  • plugin
  • tap

entry(values, config)

Modify the webpack config entry object.

// Set the `entry` to `index.js`
entry('index.js');

// Append `foo.js` to all existing entrypoints.
entry.append('foo.js');
entry((previous) => [...previous, 'foo.js'])

The entry function takes either a value to add to entry or a function that maps the existing entry values to new ones. The values property is always an array for consistency even though internally webpack can use objects, strings or arrays.

The callback has this signature:

(previous: Array, key: ?String, config: Object) => { ... }

The key property represents the key in object-style entrypoints and config is the existing webpack configuration object.

loader(loader, config)

Add a loader configuration to an existing webpack configuration.

import loader from 'webpack-partial/loader';

const babel = loader({
  test: /\.js$/,
  loader: 'babel-loader',
})
babel(webpackConfig);

output(object, config)

Merge the given output options into the output options in a webpack configuration. You can use it to do things like quickly change the publicPath.

import output from 'webpack-partial/output';
const rebase = output({publicPath: '/somewhere'});
rebase(webpackConfig);

plugin(object, config)

Append a plugin to the existing plugins in a webpack configuration.

import plugin from 'webpack-partial/plugin';
import StatsWebpackPlugin from 'stats-webpack-plugin';

const stats = plugin(new StatsWebpackPlugin())
stats(webpackConfig);

tap(func, config)

Observe the configuration but ignore any modifications. Can be useful to do things like dumping out a configuration.

import tap from 'webpack-partial/tap';
const debug = tap((config) => console.log(config));
debug(webpackConfig);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].