diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 568486f3..1b2b1bfe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,7 +86,7 @@ Click the 'Pull Request' button and fill out the form. These are mostly notes for myself. - * Be sure you are starting from a clean slate: `npm clean && npm install` + * Be sure you are starting from a clean slate: `npm run clean && npm install` * Run standard-version: `npm run release` - this will run the `ci` task * Push to GitHub: `git push --follow-tags origin master` * Publish to npmjs.com: `npm publish` diff --git a/config/webpack.browser.config.js b/config/webpack.browser.config.js deleted file mode 100644 index 3646eea2..00000000 --- a/config/webpack.browser.config.js +++ /dev/null @@ -1,66 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); -const configs = ['opossum', 'opossum.min', 'browser-test'] - .map(key => generateConfig(key)); - -// add a webpack for tests -configs.push({ - target: 'web', - mode: 'development', - entry: './test/browser/index.js', - node: { - fs: 'empty' - }, - output: { - path: path.resolve(__dirname, '..', 'test', 'browser'), - filename: 'webpack-test.js' - }, - resolve: { - modules: ['node_modules'], - extensions: ['*', '.js'] - }, - plugins: [ - new webpack.IgnorePlugin(/prom-client/), - new webpack.DefinePlugin({ - 'process.env': { - WEB: JSON.stringify('web') - } - }) - ] -}); - -function generateConfig (name) { - const mode = name.indexOf('min') > -1 ? 'production' : 'development'; - const config = { - mode, - entry: { - circuitBreaker: './index.js' - }, - output: { - path: path.resolve(__dirname, '..', 'dist'), - filename: `${name}.js`, - sourceMapFilename: `${name}.map`, - library: 'circuitBreaker', - libraryTarget: 'umd' - }, - node: { - process: true, - console: true - }, - plugins: [ - new webpack.IgnorePlugin(/prom-client/), - new webpack.ProvidePlugin({ - 'circuitBreaker': 'opossum' - }), - new webpack.DefinePlugin({ - 'process.env': { - WEB: JSON.stringify('web') - } - }) - ], - devtool: 'source-map' - }; - return config; -} - -module.exports = configs; diff --git a/config/webpack.config.js b/config/webpack.config.js index 30904aa4..91b5215c 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -3,10 +3,35 @@ const webpack = require('webpack'); const configs = ['opossum', 'opossum.min'] .map(key => generateConfig(key)); +// add a webpack for tests +configs.push({ + target: 'web', + mode: 'development', + entry: './test/browser/index.js', + node: { + fs: 'empty' + }, + output: { + path: path.resolve(__dirname, '..', 'test', 'browser'), + filename: 'webpack-test.js' + }, + resolve: { + modules: ['node_modules'], + extensions: ['*', '.js'] + }, + plugins: [ + new webpack.IgnorePlugin(/prom-client/), + new webpack.DefinePlugin({ + 'process.env': { + WEB: JSON.stringify('web') + } + }) + ] +}); + function generateConfig (name) { const mode = name.indexOf('min') > -1 ? 'production' : 'development'; const config = { - target: 'node', mode, entry: { circuitBreaker: './index.js' @@ -23,8 +48,14 @@ function generateConfig (name) { console: true }, plugins: [ + new webpack.IgnorePlugin(/prom-client/), new webpack.ProvidePlugin({ 'circuitBreaker': 'opossum' + }), + new webpack.DefinePlugin({ + 'process.env': { + WEB: JSON.stringify('web') + } }) ], devtool: 'source-map' diff --git a/docs/index.html b/docs/index.html index 472777a5..7b32d951 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@
-