diff options
author | Humberto Alfonso Díaz <humberto.alfonso@asvito.es> | 2019-06-19 08:17:22 +0200 |
---|---|---|
committer | Lorenzo Tilve <ltilve@igalia.com> | 2020-02-04 19:12:47 +0100 |
commit | 3ab4d1904d4aa356ec39b952707e72907397e5f5 (patch) | |
tree | 0a7754a3512a316e39a94024b65f783a140f2de0 /webpack.config.js | |
parent | d37d1b09b688312f0119dac93221c633a8b8458c (diff) |
STRUCT Repo structure with basic layout
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 59 |
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 |