From 0ed4427322cf91806c547882924d058699f2b0e8 Mon Sep 17 00:00:00 2001 From: Akshit Garg Date: Sat, 21 Aug 2021 17:50:45 +0530 Subject: [PATCH] refactor(assets): remove webpack.config.js Signed-off-by: Akshit Garg --- assets/webpack.config.js | 57 ---------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 assets/webpack.config.js diff --git a/assets/webpack.config.js b/assets/webpack.config.js deleted file mode 100644 index 09c4f23..0000000 --- a/assets/webpack.config.js +++ /dev/null @@ -1,57 +0,0 @@ -const path = require('path'); -const glob = require('glob'); -const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const TerserPlugin = require('terser-webpack-plugin'); -const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); - -module.exports = (env, options) => { - const devMode = options.mode !== 'production'; - - const PATHS = { - src: path.join(__dirname, '../') - } - - return { - optimization: { - minimizer: [ - new TerserPlugin({ cache: true, parallel: true, sourceMap: devMode }), - new OptimizeCSSAssetsPlugin({}) - ] - }, - entry: { - 'app': glob.sync('./vendor/**/*.js').concat(['./js/app.js']) - }, - output: { - filename: '[name].js', - path: path.resolve(__dirname, '../priv/static/js'), - publicPath: '/js/' - }, - devtool: devMode ? 'eval-cheap-module-source-map' : undefined, - module: { - rules: [ - { - test: /\.js$/, - exclude: /node_modules/, - use: { - loader: 'babel-loader' - } - }, - { - test: /\.[s]?css$/, - use: [ - MiniCssExtractPlugin.loader, - 'css-loader', - 'postcss-loader', - ], - } - ] - }, - plugins: [ - new MiniCssExtractPlugin({ filename: '../css/app.css' }), - new CopyWebpackPlugin([{ from: 'static/', to: '../' }]), - ] - .concat(devMode ? [new HardSourceWebpackPlugin()] : []) - } -};