From 7111c7c0e97184ef5d1c32195bffaa022ac369fe Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 20 Apr 2023 23:07:09 -0700 Subject: [PATCH] lint: format webpack.js with prettier Signed-off-by: Varun Patil --- webpack.js | 65 ++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/webpack.js b/webpack.js index df334c98..aaf6e378 100644 --- a/webpack.js +++ b/webpack.js @@ -1,51 +1,48 @@ -const webpackConfig = require('@nextcloud/webpack-vue-config') -const WorkboxPlugin = require('workbox-webpack-plugin') -const path = require('path') -const TerserPlugin = require('terser-webpack-plugin') +const webpackConfig = require('@nextcloud/webpack-vue-config'); +const WorkboxPlugin = require('workbox-webpack-plugin'); +const path = require('path'); +const TerserPlugin = require('terser-webpack-plugin'); -const buildMode = process.env.NODE_ENV -const isDev = buildMode === 'development' +const buildMode = process.env.NODE_ENV; +const isDev = buildMode === 'development'; webpackConfig.module.rules.push({ - test: /\.ts?$/, - loader: 'ts-loader', - exclude: /node_modules/, - options: { - appendTsSuffixTo: [/\.vue$/], - }, + test: /\.ts?$/, + loader: 'ts-loader', + exclude: /node_modules/, + options: { + appendTsSuffixTo: [/\.vue$/], + }, }); webpackConfig.resolve.extensions.push('.ts'); webpackConfig.resolve.alias = { - 'vue$': 'vue/dist/vue.esm.js', -} + vue$: 'vue/dist/vue.esm.js', +}; webpackConfig.entry.main = path.resolve(path.join('src', 'main')); webpackConfig.watchOptions = { - ignored: /node_modules/, - aggregateTimeout: 300, + ignored: /node_modules/, + aggregateTimeout: 300, }; webpackConfig.plugins.push( - new WorkboxPlugin.InjectManifest({ - swSrc: path.resolve(path.join('src', 'service-worker.js')), - swDest: 'memories-service-worker.js', - }) + new WorkboxPlugin.InjectManifest({ + swSrc: path.resolve(path.join('src', 'service-worker.js')), + swDest: 'memories-service-worker.js', + }) ); // Exclusions from minification -const minifyExclude = [ - /filerobot-image-editor/, -] +const minifyExclude = [/filerobot-image-editor/]; -webpackConfig.optimization.minimizer[0] = - new TerserPlugin({ - exclude: minifyExclude, - terserOptions: { - output: { - comments: false, - } - }, - extractComments: true, - }); +webpackConfig.optimization.minimizer[0] = new TerserPlugin({ + exclude: minifyExclude, + terserOptions: { + output: { + comments: false, + }, + }, + extractComments: true, +}); -module.exports = webpackConfig +module.exports = webpackConfig;