0.0.5 • Published 6 years ago
@lithiumlron/webpack-partials v0.0.5
webpack-partials
webpack-partials provides a set of configuration objects used to quickly compose webpack configuration.
Prerequisites
- Understand how webpack works and what it can do for you.
- Ensure webpack 2+ and webpack-merge are installed in your project.
Resources
- Webpack: From Apprentice to Master is a good starting point for learning how to use webpack.
- webpack-merge - Taming Webpack Configuration - Interview with Juho Vepsäläinen explains
webpack-merge
and its usage for writing composable configuration in webpack.
Installation
npm install @lithiumlron/webpack-partials
Usage
// Import modules.
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const webpackPartials = require('@lithiumlron/webpack-partials');
// Write webpack configuration.
module.exports = webpackMerge([
// Base webpack configuration
{/* ... */},
// Add partial.
webpackPartials.devServer({
host: 'localhost',
port: '3000'
}),
// Add another partial.
webpackPartials.loadCSS()
]);
Available Tasks
- Extract CSS
- Load CSS
- Start local development server
- Process CSS (post-build)