diff options
| author | stonedDiscord <stonedDiscord@users.noreply.github.com> | 2024-11-20 13:04:14 +0000 |
|---|---|---|
| committer | GitHub Action <actions@github.com> | 2024-11-20 13:04:14 +0000 |
| commit | b8283b373caa2ac198497a8dd466bf494d81982a (patch) | |
| tree | 23de734e7ab5c093ace1d1a8fec716bb7603bdbf /webpack.config.js | |
| parent | 376fadcca3a1b5c32a3361b2843c6c576237a1a3 (diff) | |
Prettified Code!
Diffstat (limited to 'webpack.config.js')
| -rw-r--r-- | webpack.config.js | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/webpack.config.js b/webpack.config.js index f4b34b5..f31cb56 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,59 +1,60 @@ /* eslint-env node */ -const path = require('path'); -const dotenv = require('dotenv'); -const webpack = require('webpack'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const CopyPlugin = require('copy-webpack-plugin'); -const WorkboxPlugin = require('workbox-webpack-plugin'); -const glob = require('glob'); +const path = require("path"); +const dotenv = require("dotenv"); +const webpack = require("webpack"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const CopyPlugin = require("copy-webpack-plugin"); +const WorkboxPlugin = require("workbox-webpack-plugin"); +const glob = require("glob"); // this will update the process.env with environment variables in .env file dotenv.config(); module.exports = { entry: { - ui: './webAO/ui.js', - client: './webAO/client.ts', - master: './webAO/master.ts', + ui: "./webAO/ui.js", + client: "./webAO/client.ts", + master: "./webAO/master.ts", dom: { - dependOn: 'client', - import: glob.sync('./webAO/dom/*.{js,ts}') + dependOn: "client", + import: glob.sync("./webAO/dom/*.{js,ts}"), }, - components: glob.sync('./webAO/components/*.js'), + components: glob.sync("./webAO/components/*.js"), }, node: { global: true, }, - devtool: 'source-map', + devtool: "source-map", resolve: { - extensions: ['.js', '.jsx', '.tsx', '.ts', '.json'], + extensions: [".js", ".jsx", ".tsx", ".ts", ".json"], }, devServer: { static: { - directory: path.join(__dirname, 'webAO'), + directory: path.join(__dirname, "webAO"), }, compress: true, port: 8080, }, - mode: 'production', + mode: "production", module: { rules: [ { test: /\.m?js$/, exclude: /(node_modules|bower_components)/, use: { - loader: 'babel-loader', + loader: "babel-loader", options: { presets: [ [ - '@babel/preset-env', { - useBuiltIns: 'usage', + "@babel/preset-env", + { + useBuiltIns: "usage", targets: [ - 'defaults', - 'Safari > 3', - 'Opera > 8', - 'Android > 3', + "defaults", + "Safari > 3", + "Opera > 8", + "Android > 3", ], corejs: 3, }, @@ -68,8 +69,8 @@ module.exports = { ], }, output: { - path: path.resolve(__dirname, 'dist'), - filename: '[name].[contenthash].bundle.js', + path: path.resolve(__dirname, "dist"), + filename: "[name].[contenthash].bundle.js", clean: true, }, performance: { @@ -80,30 +81,28 @@ module.exports = { plugins: [ new CopyPlugin({ patterns: [ - { from: path.resolve(__dirname, 'webAO', 'styles'), to: 'styles' }, - { from: path.resolve(__dirname, 'static') }, - { from: path.resolve(__dirname, 'webAO', 'golden'), to: 'golden' }, - { from: path.resolve(__dirname, 'webAO', 'lib'), to: 'lib' }, + { from: path.resolve(__dirname, "webAO", "styles"), to: "styles" }, + { from: path.resolve(__dirname, "static") }, + { from: path.resolve(__dirname, "webAO", "golden"), to: "golden" }, + { from: path.resolve(__dirname, "webAO", "lib"), to: "lib" }, ], }), new HtmlWebpackPlugin({ - filename: 'index.html', - template: 'public/index.html', - chunks: ['master', 'sw'], - title: 'Attorney Online', + filename: "index.html", + template: "public/index.html", + chunks: ["master", "sw"], + title: "Attorney Online", }), new HtmlWebpackPlugin({ - title: 'Attorney Online', - filename: 'client.html', - chunks: ['client', 'ui', 'dom', 'components'], - template: 'public/client.html', + title: "Attorney Online", + filename: "client.html", + chunks: ["client", "ui", "dom", "components"], + template: "public/client.html", }), new webpack.DefinePlugin({ - 'process.env': JSON.stringify(process.env), + "process.env": JSON.stringify(process.env), }), // new WorkboxPlugin.GenerateSW(), - ], - }; |
