aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorcaleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu>2022-03-05 21:40:08 -0500
committercaleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu>2022-03-05 21:40:08 -0500
commit88715ee53ab4f58deea9c6f0dd7bbe0ac6d1b03e (patch)
tree0acf942cde98c66f53083a7700eae7cc1c8c8a90 /webpack.config.js
parentccde3bded6b714c385fd3d9e512186ca7019c01b (diff)
Alphabetized and added webpack config things
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js94
1 files changed, 58 insertions, 36 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 2754b21..ae56719 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,45 +1,67 @@
/* eslint-env node */
const path = require('path');
+const dotenv = require('dotenv')
+const webpack = require('webpack')
+
+// this will update the process.env with environment variables in .env file
+dotenv.config();
module.exports = {
- entry: {
- ui: './webAO/ui.js',
- client: './webAO/client.js',
- master: './webAO/master.js'
- },
- output: {
- path: path.resolve(__dirname, 'webAO'),
- filename: '[name].b.js'
+ entry: {
+ ui: './webAO/ui.js',
+ client: './webAO/client.js',
+ master: './webAO/master.js'
+ },
+ devtool: 'source-map',
+ devServer: {
+ static: {
+ directory: path.join(__dirname, 'webAO'),
},
- module: {
- rules: [
- {
- test: /\.m?js$/,
- exclude: /(node_modules|bower_components)/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: [
- [
- '@babel/preset-env', {
- useBuiltIns: 'usage',
- targets: [
- "defaults",
- "Safari > 3",
- "Opera > 8",
- "Android > 3"
- ],
- corejs: 3
- }
- ]
- ]
- }
- }
+ compress: true,
+ port: 8080,
+ },
+ mode: 'production',
+ module: {
+ rules: [
+ {
+ test: /\.m?js$/,
+ exclude: /(node_modules|bower_components)/,
+ use: {
+ loader: 'babel-loader',
+ options: {
+ presets: [
+ [
+ '@babel/preset-env', {
+ useBuiltIns: 'usage',
+ targets: [
+ "defaults",
+ "Safari > 3",
+ "Opera > 8",
+ "Android > 3"
+ ],
+ corejs: 3
+ }
+ ]
+ ]
}
- ]
- },
+ }
+ }
+ ]
+ },
+ output: {
+ path: path.resolve(__dirname, 'webAO'),
+ filename: '[name].b.js'
+ },
+ performance: {
+ hints: false,
+ maxEntrypointSize: 512000,
+ maxAssetSize: 512000
+ },
+ plugins: [
+ new webpack.DefinePlugin({
+ 'process.env': JSON.stringify(process.env)
+ })
+ ],
- devtool: 'source-map',
- mode: 'production'
}; \ No newline at end of file