aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.config.js
diff options
context:
space:
mode:
authorHumberto Alfonso Díaz <humberto.alfonso@asvito.es>2019-06-19 08:17:22 +0200
committerLorenzo Tilve <ltilve@igalia.com>2020-02-04 09:41:14 +0100
commit577649504775349936391330a8bdf3fd58464a67 (patch)
tree0a7754a3512a316e39a94024b65f783a140f2de0 /webpack.config.js
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
STRUCT Repo structure with basic layout
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js59
1 files changed, 59 insertions, 0 deletions
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