diff options
author | Francesco Cioria <firefelix@gmail.com> | 2017-01-04 15:38:58 +0100 |
---|---|---|
committer | Francesco Cioria <firefelix@gmail.com> | 2017-01-04 15:38:58 +0100 |
commit | 56feeb88955bf9defd7863e12fc591fe51690c21 (patch) | |
tree | d846f8b93e1dcafd3ad7fea5458d77266c43fe5c /examples | |
parent | 8ad64ef8459b8370901464fff95425384afd7cb0 (diff) | |
download | react-autosize-textarea-56feeb88955bf9defd7863e12fc591fe51690c21.zip react-autosize-textarea-56feeb88955bf9defd7863e12fc591fe51690c21.tar.gz react-autosize-textarea-56feeb88955bf9defd7863e12fc591fe51690c21.tar.bz2 |
refactor webpack config files
Diffstat (limited to 'examples')
-rw-r--r-- | examples/webpack.base.babel.js (renamed from examples/webpack.base.js) | 14 | ||||
-rw-r--r-- | examples/webpack.config.babel.js | 27 | ||||
-rw-r--r-- | examples/webpack.config.build.babel.js | 20 | ||||
-rw-r--r-- | examples/webpack.config.build.js | 26 | ||||
-rw-r--r-- | examples/webpack.config.js | 33 |
5 files changed, 53 insertions, 67 deletions
diff --git a/examples/webpack.base.js b/examples/webpack.base.babel.js index 90d7ed0..4faa837 100644 --- a/examples/webpack.base.js +++ b/examples/webpack.base.babel.js @@ -1,13 +1,12 @@ -var path = require('path'); -var webpack = require('webpack'); +import path from 'path'; -var paths = { +export const paths = { SRC: path.resolve(__dirname, '../src'), - EXAMPLES: path.resolve(__dirname, '.') + EXAMPLES: path.resolve(__dirname, '.'), + ENTRY: path.resolve(__dirname, './examples.js') }; -module.exports = { - +export default { output: { path: paths.EXAMPLES, filename: 'bundle.js' @@ -31,5 +30,4 @@ module.exports = { } ] } - -};
\ No newline at end of file +}; diff --git a/examples/webpack.config.babel.js b/examples/webpack.config.babel.js new file mode 100644 index 0000000..e28c1eb --- /dev/null +++ b/examples/webpack.config.babel.js @@ -0,0 +1,27 @@ +import webpack from 'webpack'; +import webpackBase, { paths } from './webpack.base.babel'; + +export default { + ...webpackBase, + + entry: [ + 'webpack/hot/dev-server', + paths.ENTRY + ], + + devtool: 'source-map', + + devServer: { + contentBase: paths.EXAMPLES, + host: '0.0.0.0', + hot: true, + inline: true, + port: '8080' + }, + + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') + }) + ] +}; diff --git a/examples/webpack.config.build.babel.js b/examples/webpack.config.build.babel.js new file mode 100644 index 0000000..6ebd1c4 --- /dev/null +++ b/examples/webpack.config.build.babel.js @@ -0,0 +1,20 @@ +import webpack from 'webpack'; +import webpackBase, { paths } from './webpack.base.babel'; + +export default { + ...webpackBase, + + entry: paths.ENTRY, + + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production') + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + } + }) + ] + +}; diff --git a/examples/webpack.config.build.js b/examples/webpack.config.build.js deleted file mode 100644 index ad387a9..0000000 --- a/examples/webpack.config.build.js +++ /dev/null @@ -1,26 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var webpackBase = require('./webpack.base'); -var assign = require('lodash/object').assign; - -var paths = { - SRC: path.resolve(__dirname, '../src'), - EXAMPLES: path.resolve(__dirname, '.') -}; - -module.exports = assign(webpackBase, { - - entry: paths.EXAMPLES + '/examples.js', - - plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('production') - }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false - } - }) - ] - -}); diff --git a/examples/webpack.config.js b/examples/webpack.config.js deleted file mode 100644 index 0ba53ec..0000000 --- a/examples/webpack.config.js +++ /dev/null @@ -1,33 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var webpackBase = require('./webpack.base'); -var assign = require('lodash/object').assign; - -var paths = { - SRC: path.resolve(__dirname, '../src'), - EXAMPLES: path.resolve(__dirname, '.') -}; - -module.exports = assign(webpackBase, { - - entry: [ - 'webpack/hot/dev-server', - paths.EXAMPLES + '/examples.js' - ], - - devtool: 'source-map', - - devServer: { - contentBase: paths.EXAMPLES, - hot: true, - inline: true, - port: '8080' - }, - - plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('development') - }) - ] - -}); |