All Projects → Fitbit → Webpack Config

Fitbit / Webpack Config

Licence: apache-2.0
Helps to load, extend and merge webpack configs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Webpack Config

Angular Cli Webpack
Webpack configuration modifier for @angular/cli
Stars: ✭ 72 (-70.49%)
Mutual labels:  webpack, webpack-configuration
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-61.48%)
Mutual labels:  webpack, webpack-configuration
Auxpack
A dashboard for monitoring Webpack build stats.
Stars: ✭ 86 (-64.75%)
Mutual labels:  webpack, webpack-configuration
React App Rewired
Override create-react-app webpack configs without ejecting
Stars: ✭ 8,630 (+3436.89%)
Mutual labels:  webpack, config
Webpack Config Handbook
Minimum Webpack config handbook & examples
Stars: ✭ 165 (-32.38%)
Mutual labels:  webpack, webpack-configuration
Generate Pages Tutorial
教你一步步从零构建 webpack 开发多页面环境
Stars: ✭ 63 (-74.18%)
Mutual labels:  webpack, config
Wpk
a friendly, intuitive & intelligent CLI for webpack
Stars: ✭ 232 (-4.92%)
Mutual labels:  webpack, webpack-configuration
Annotated Webpack Config
This is the companion github repo for the "An Annotated webpack 4 Config for Frontend Web Development" article.
Stars: ✭ 425 (+74.18%)
Mutual labels:  webpack, config
Sharejs
💻js小技巧、react、webpack、redux、javascript及其它前端干货,持续更新ing
Stars: ✭ 141 (-42.21%)
Mutual labels:  webpack, webpack-configuration
Preact Minimal
🚀 Minimal preact structure
Stars: ✭ 136 (-44.26%)
Mutual labels:  webpack, webpack-configuration
Generate Pages
webpack 开发多页面脚手架
Stars: ✭ 51 (-79.1%)
Mutual labels:  webpack, config
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 (-18.44%)
Mutual labels:  webpack, webpack-configuration
Universal
Seed project for Angular Universal apps featuring Server-Side Rendering (SSR), Webpack, CLI scaffolding, dev/prod modes, AoT compilation, HMR, SCSS compilation, lazy loading, config, cache, i18n, SEO, and TSLint/codelyzer
Stars: ✭ 669 (+174.18%)
Mutual labels:  webpack, config
Vscode Ts Webpack Node Debug Example
VSCode TypeScript Webpack Node Debug Example
Stars: ✭ 66 (-72.95%)
Mutual labels:  webpack, webpack-configuration
Webpack Config Plugins
Provide best practices for webpack loader configurations
Stars: ✭ 529 (+116.8%)
Mutual labels:  webpack, config
Angular Librarian
An Angular 2+ scaffolding setup for creating libraries
Stars: ✭ 92 (-62.3%)
Mutual labels:  webpack, 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 (-0.82%)
Mutual labels:  webpack, webpack-configuration
Serverless Webpack
Serverless plugin to bundle your lambdas with Webpack
Stars: ✭ 1,595 (+553.69%)
Mutual labels:  webpack, webpack-configuration
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 (-29.92%)
Mutual labels:  webpack, webpack-configuration
Webpack Chain
A chaining API to generate and simplify the modification of Webpack configurations.
Stars: ✭ 2,821 (+1056.15%)
Mutual labels:  webpack, webpack-configuration

NPM version Travis build status AppVeyor build status Code Climate Maintainability Code Climate Coverage Dependency Status Development Dependency Status Greenkeeper badge

webpack-config

Helps to load, extend and merge webpack configs

Installation

npm install webpack-config --save-dev

or

yarn add webpack-config --dev

Features

  • [x] #extend() - Helps to extend config using local file or shareable config
  • [x] #merge() - Helps to merge some values into config and overrides existing ones
  • [x] #defaults() - Helps to add some values if they are missing
  • [x] Supports environment variables under #extend(), #merge(), #defaults() methods
  • [x] Supports process.env.* variables in addition to environment ones
  • [x] Supports shareable configs via node-modules

Changelog

Details changes for each release are documented in the release notes and also in the wiki page.

Shareable Configs

You can publish your configs to npm using webpack-config- prefix for package name.

When you call #extend() method you may omit that prefix:

import Config from "webpack-config";

export default new Config().extend(
  "mdreizin/base",
  "mdreizin/css",
  "mdreizin/html",
  "webpack-config-mdreizin/json"
  // etc
);

Also I would recommend to add webpack and webpack-config keywords so other users can easily find your module.

Usage

./webpack.config.js

import Config, { environment } from "webpack-config";

environment.setAll({
  env: () => process.env.NODE_ENV
});

// Also you may use `'conf/webpack.[NODE_ENV].config.js'`
export default new Config().extend("conf/webpack.[env].config.js");

./conf/webpack.base.config.js

import ExtractTextPlugin from "extract-text-webpack-plugin";
import Config from "webpack-config";

const extractCss = new ExtractTextPlugin("[name].css");

export default new Config().merge({
  output: {
    filename: "[name].js"
  },
  resolve: {
    root: [__dirname],
    modulesDirectories: ["node_modules"]
  },
  plugins: [extractCss],
  module: {
    loaders: [
      {
        test: /\.less$/,
        loader: extractCss.extract("style", ["css", "less"])
      }
    ]
  }
});

./conf/webpack.development.config.js

import webpack from "webpack";
import Config from "webpack-config";

export default new Config().extend("conf/webpack.base.config.js").merge({
  debug: true,
  devtool: "#source-map",
  output: {
    pathinfo: true
  },
  entry: {
    app: ["src/index.js", "src/index.less"],
    vendor: ["lodash"]
  },
  plugins: [new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.js")]
});

./conf/webpack.production.config.js

import webpack from "webpack";
import Config from "webpack-config";

export default new Config()
  .extend({
    "conf/webpack.development.config.js": config => {
      delete config.debug;
      delete config.devtool;
      delete config.output.pathinfo;

      return config;
    }
  })
  .merge({
    plugins: [
      new webpack.optimize.DedupePlugin(),
      new webpack.optimize.OccurrenceOrderPlugin(true),
      new webpack.optimize.UglifyJsPlugin({
        mangle: true,
        output: {
          comments: false
        },
        compress: {
          warnings: false
        }
      })
    ]
  });
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].