From 3ab4d1904d4aa356ec39b952707e72907397e5f5 Mon Sep 17 00:00:00 2001 From: Humberto Alfonso Díaz Date: Wed, 19 Jun 2019 08:17:22 +0200 Subject: STRUCT Repo structure with basic layout --- webpack.config.js | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 webpack.config.js (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..c4934a0 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,59 @@ +const path = require('path'); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const MiniCSSExtractPlugin = require('mini-css-extract-plugin'); +const CopyPlugin = require('copy-webpack-plugin'); + +module.exports = { + mode: 'production', + entry: './src/app.js', + output: { + filename: 'app.js', + path: __dirname + '/dist' + }, + optimization: { + minimizer: [new UglifyJsPlugin()], + }, + plugins: [ + new CleanWebpackPlugin(['dist']), + new CopyPlugin([ + { + from: 'src/icon.*', + flatten: true + }, + { + from: 'src/config.xml', + flatten: true + } + ]), + new HtmlWebpackPlugin({ + template: 'src/index.html', + filename: 'index.html', + inject: 'head' + }), + new MiniCSSExtractPlugin({ + filename: 'app.css', + path: __dirname + '/dist' + }) + ], + module: { + rules: [ + { + test: /\.css$/, + use: [ + 'style-loader', + 'css-loader' + ] + }, + { + test: /\.scss$/, + use: [ + MiniCSSExtractPlugin.loader, + "css-loader", + "sass-loader" + ] + } + ] + } +};  \ No newline at end of file -- cgit 1.2.3-korg