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

Commit

Permalink
feat(Config): introduces new simple API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Previously exposed internal classes and instances are now really internal.

For most cases everything will work fine, but anyway please check https://github.com/Fitbit/webpack-config/wiki/Changelog
  • Loading branch information
mdreizin committed Feb 7, 2017
1 parent 4326357 commit c57c036
Show file tree
Hide file tree
Showing 60 changed files with 4,183 additions and 1,204 deletions.
7 changes: 4 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"add-module-exports",
"transform-runtime"
],
"ignore": [
"node_modules/",
"**/wallaby/wallaby/**"
"only": [
"src/",
"test/",
"jasmine.js"
]
}
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"sourceType": "module"
},
"plugins": [
"babel"
"babel",
"markdown"
],
"rules": {
"valid-jsdoc": ["error", {
Expand Down
73 changes: 0 additions & 73 deletions .gitdown/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions .gitdown/conf/webpack.base.config.js

This file was deleted.

23 changes: 0 additions & 23 deletions .gitdown/conf/webpack.development.config.js

This file was deleted.

27 changes: 0 additions & 27 deletions .gitdown/conf/webpack.production.config.js

This file was deleted.

8 changes: 0 additions & 8 deletions .gitdown/webpack.config.js

This file was deleted.

9 changes: 0 additions & 9 deletions .gitdown/webpack.npm.config.js

This file was deleted.

8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ branches:
before_install:
- git config --global user.name "$GH_USER_NAME"
- git config --global user.email "$GH_USER_EMAIL"
before_script:
- npm prune
script:
- npm run clean
- npm run eslint
- npm run cover
- yarn run clean
- yarn run eslint
- yarn run cover
after_script:
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && .travis/after-all.sh || false'
10 changes: 5 additions & 5 deletions .travis/after-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ declare exitCode;
$(npm bin)/travis-after-all
exitCode=$?
if [ $exitCode -eq 0 ]; then
npm run build;
npm run codeclimate;
npm run semantic-release;
npm run jsdoc;
npm run gh-pages;
yarn run build;
yarn run codeclimate;
yarn run semantic-release;
yarn run jsdoc;
yarn run gh-pages;
fi
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[![NPM version](http://img.shields.io/npm/v/webpack-config.svg?style=flat-square)](https://www.npmjs.org/package/webpack-config)
[![Travis build status](http://img.shields.io/travis/Fitbit/webpack-config/master.svg?style=flat-square)](https://travis-ci.org/Fitbit/webpack-config)
[![AppVeyor build status](https://img.shields.io/appveyor/ci/mdreizin/webpack-config/master.svg?style=flat-square)](https://ci.appveyor.com/project/mdreizin/webpack-config/branch/master)
[![Code Climate GPA](https://img.shields.io/codeclimate/github/Fitbit/webpack-config.svg?style=flat-square)](https://codeclimate.com/github/Fitbit/webpack-config)
[![Code Climate Coverage](https://img.shields.io/codeclimate/coverage/github/Fitbit/webpack-config.svg?style=flat-square)](https://codeclimate.com/github/Fitbit/webpack-config)
[![Dependency Status](https://img.shields.io/david/Fitbit/webpack-config.svg?style=flat-square)](https://david-dm.org/Fitbit/webpack-config)
[![Development Dependency Status](https://img.shields.io/david/dev/Fitbit/webpack-config.svg?style=flat-square)](https://david-dm.org/Fitbit/webpack-config#info=devDependencies)

<a name="webpack-config"></a>
[![NPM version](http://img.shields.io/npm/v/webpack-config.svg)](https://www.npmjs.org/package/webpack-config)
[![Travis build status](http://img.shields.io/travis/Fitbit/webpack-config/master.svg)](https://travis-ci.org/Fitbit/webpack-config)
[![AppVeyor build status](https://img.shields.io/appveyor/ci/mdreizin/webpack-config/master.svg)](https://ci.appveyor.com/project/mdreizin/webpack-config/branch/master)
[![Code Climate GPA](https://img.shields.io/codeclimate/github/Fitbit/webpack-config.svg)](https://codeclimate.com/github/Fitbit/webpack-config)
[![Code Climate Coverage](https://img.shields.io/codeclimate/coverage/github/Fitbit/webpack-config.svg)](https://codeclimate.com/github/Fitbit/webpack-config)
[![Dependency Status](https://img.shields.io/david/Fitbit/webpack-config.svg)](https://david-dm.org/Fitbit/webpack-config)
[![Development Dependency Status](https://img.shields.io/david/dev/Fitbit/webpack-config.svg)](https://david-dm.org/Fitbit/webpack-config#info=devDependencies)

# webpack-config
> Helps to load, extend and merge webpack configs
<a name="webpack-config-installation"></a>
## Installation

```bash
Expand All @@ -23,7 +21,6 @@ or
yarn add webpack-config --dev
```

<a name="webpack-config-features"></a>
## Features

- [x] `#extend()` - Helps to extend config using local file or shareable config
Expand All @@ -33,12 +30,10 @@ yarn add webpack-config --dev
- [x] Supports `process.env.*` variables in addition to `environment` ones
- [x] Supports shareable configs via `node`-modules

<a name="webpack-config-changelog"></a>
## Changelog

Details changes for each release are documented in the [release notes](https://github.com/Fitbit/webpack-config/releases) and also in the [wiki page](https://github.com/Fitbit/webpack-config/wiki/Changelog).

<a name="webpack-config-shareable-configs"></a>
## Shareable Configs

You can publish your configs to `npm` using `webpack-config-` prefix for package name.
Expand All @@ -55,12 +50,10 @@ export default new Config().extend(
'webpack-config-mdreizin/json'
// etc
);

```

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

<a name="webpack-config-usage"></a>
## Usage

`./webpack.config.js`
Expand All @@ -74,7 +67,6 @@ environment.setAll({

// 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`
Expand Down Expand Up @@ -110,7 +102,6 @@ export default new Config().merge({
}]
}
});

```

`./conf/webpack.development.config.js`
Expand All @@ -120,7 +111,6 @@ import webpack from 'webpack';
import Config from 'webpack-config';

export default new Config().extend('conf/webpack.base.config.js').merge({
filename: __filename,
debug: true,
devtool: '#source-map',
output: {
Expand All @@ -139,7 +129,6 @@ export default new Config().extend('conf/webpack.base.config.js').merge({
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js')
]
});

```

`./conf/webpack.production.config.js`
Expand All @@ -157,7 +146,6 @@ export default new Config().extend({
return config;
}
}).merge({
filename: __filename,
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin(true),
Expand All @@ -172,5 +160,4 @@ export default new Config().extend({
})
]
});

```
38 changes: 18 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
"src/"
],
"scripts": {
"clean": "rm -rf ./dist && rm -rf ./coverage && rm -rf ./docs",
"eslint": "eslint ./ --cache",
"clean": "rm -rf dist coverage docs",
"eslint": "eslint --ext js,md ./ --cache",
"build": "babel src --out-dir dist --source-maps",
"test": "babel-node jasmine.js",
"cover": "NODE_ENV=test nyc --reporter=lcov jasmine JASMINE_CONFIG_PATH=jasmine.json",
"postcover": "nyc report",
"codeclimate": "codeclimate-test-reporter < ./coverage/lcov.info",
"gitdown": "gitdown ./.gitdown/README.md --output-file ./README.md",
"jsdoc": "jsdoc ./src -c ./jsdoc.json",
"gh-pages": "gh-pages -r https://${GH_TOKEN}@github.com/Fitbit/webpack-config.git -d docs",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
Expand Down Expand Up @@ -44,32 +43,31 @@
},
"homepage": "https://github.com/Fitbit/webpack-config",
"devDependencies": {
"babel-cli": "^6.14.0",
"babel-eslint": "^7.0.0",
"babel-cli": "^6.22.2",
"babel-eslint": "^7.1.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-istanbul": "^3.0.0",
"babel-plugin-istanbul": "^3.1.2",
"babel-plugin-transform-builtin-extend": "^1.1.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.16.3",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-es2015": "^6.22.0",
"babel-register": "^6.22.0",
"codeclimate-test-reporter": "^0.4.0",
"eslint": "^3.12.1",
"eslint-plugin-babel": "^4.0.0",
"eslint": "^3.14.1",
"eslint-plugin-babel": "^4.0.1",
"eslint-plugin-markdown": "^1.0.0-beta.3",
"gh-pages": "^0.12.0",
"gitdown": "^2.4.8",
"jasmine": "^2.5.3",
"jasmine-spec-reporter": "^3.1.0",
"jsdoc": "^3.4.0",
"nyc": "^10.0.0",
"jasmine-spec-reporter": "^3.2.0",
"jsdoc": "^3.4.3",
"nyc": "^10.1.2",
"semantic-release": "^6.3.2",
"travis-after-all": "^1.4.4"
},
"dependencies": {
"babel-runtime": "^6.9.0",
"babel-runtime": "^6.22.0",
"constitute": "^1.6.2",
"glob": "^7.0.6",
"glob2base": "0.0.12",
"lodash": "^4.17.2",
"recursive-iterator": "^2.0.0"
"lodash": "^4.17.4",
"recursive-iterator": "^2.0.3",
"yargs": "^6.6.0"
}
}

0 comments on commit c57c036

Please sign in to comment.