2.0.4 • Published 7 years ago

flat-webpack-config v2.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

flat-webpack-config

A flat configuration helper for webpack

Install

npm i -d flat-webpack-config

Usage

Initialize your module

mkdir project-name
cd project-name
npm init
npm i -d flat-webpack-config

Create a flat-webpack-config.json

{
  "bundles": {
    "app": {
      "anticore": "anticore"
    },
    "polyfills": {
      "fetch": "whatwg-fetch",
      "Promise": "es6-promise/dist/es6-promise.auto.min.js",
      "URL": "js-polyfills/url.js"
    }
  },
  "map": true,
  "output": "./assets/js",
  "spaces": 2
}

Create a webpack.config.js

'use strict';

module.exports = require('flat-webpack-config')(__dirname);

// or avoid the `flat-webpack-config.json` file by
module.exports = require('flat-webpack-config')(__dirname, {
  "bundles": {
    "app": {
      "anticore": "anticore"
    },
    "polyfills": {
      "fetch": "whatwg-fetch",
      "Promise": "es6-promise/dist/es6-promise.auto.min.js",
      "URL": "js-polyfills/url.js"
    }
  },
  "map": true,
  "output": "./assets/js",
  "spaces": 2
});

Run webpack

webpack

Tip: Target old browsers to load the polyfills

<script defer nomodule src="assets/js/polyfills.min.js"></script>
<script defer src="assets/js/app.min.js"></script>
2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.0

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago