aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-10 20:21:42 +0900
committerGitHub <noreply@github.com>2017-10-10 20:21:42 +0900
commit956b5d5a965361df9396131934850b1698461ec2 (patch)
tree0afb33a3a90a316bab9d1f60c2750fc6e4c7a92c /webpack.config.js
parentb776608f08aa15338294b49b15967f57fe297fed (diff)
parent120fd9b02653ce2b6ef447b6ea50fb15514dbb10 (diff)
Merge pull request #32 from ueokande/build-package
Build package
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 977ea75..16d437f 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,10 +1,11 @@
-var HtmlWebpackPlugin = require('html-webpack-plugin');
-var path = require('path');
+const MinifyPlugin = require("babel-minify-webpack-plugin");
+const HtmlWebpackPlugin = require('html-webpack-plugin');
+const path = require('path');
const src = path.resolve(__dirname, 'src');
const dist = path.resolve(__dirname, 'build');
-module.exports = {
+config = {
entry: {
content: path.join(src, 'content'),
settings: path.join(src, 'settings'),
@@ -56,3 +57,8 @@ module.exports = {
})
]
};
+if (process.env.NODE_ENV === 'production') {
+ config.plugins.push(new MinifyPlugin());
+}
+
+module.exports = config