diff options
| -rw-r--r-- | README.md | 13 | ||||
| -rw-r--r-- | package.json | 6 | ||||
| -rw-r--r-- | webAO/client.js | 2 | ||||
| -rw-r--r-- | webAO/master.js | 2 | ||||
| -rw-r--r-- | webpack.config.js | 16 |
5 files changed, 32 insertions, 7 deletions
@@ -12,7 +12,16 @@ Desktop-only features: - Non-interrupting preanimations In short, webAO is in disrepair. Again. - + Link to the client in this repo: http://web.aceattorneyonline.com/ -Guide to installing it locally: https://docs.google.com/document/d/1X4OjG0tfoTZayqY9MM6fqzL_aGMKFAECg7NSQRYafAU/edit +# Project Setup +- Install [Node JS](https://nodejs.org/en/) + +# Running Locally +`npm install` + +`npm run start` + + + diff --git a/package.json b/package.json index f8908ea..7971138 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "deploy": "cross-env NODE_ENV=production webpack -p", "test": "echo \"Error: no test specified\" && exit 1", "build": "webpack --config webpack.config.js", - "start": "webpack-dev-server --config webpack.config.js", + "start": "webpack serve --config webpack.config.js", "lint": "eslint . --ext .js", "lint:fix": "eslint --fix . --ext .js" }, @@ -26,11 +26,13 @@ "@babel/core": "^7.17.5", "@babel/preset-env": "^7.16.11", "babel-loader": "^8.2.3", + "dotenv": "^16.0.0", "eslint": "^8.10.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-plugin-import": "^2.25.4", "webpack": "^5.69.1", - "webpack-cli": "^4.9.2" + "webpack-cli": "^4.9.2", + "webpack-dev-server": "^4.7.4" }, "dependencies": { "@fingerprintjs/fingerprintjs": "^3.3.3", diff --git a/webAO/client.js b/webAO/client.js index 8b742d3..86abb63 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -19,7 +19,7 @@ import vanilla_evidence_arr from './evidence.js'; import chatbox_arr from './styles/chatbox/chatboxes.js'; -import { version } from '../package.json'; +const version = process.env.npm_package_version let client; let viewport; diff --git a/webAO/master.js b/webAO/master.js index f50b2a6..ad0a577 100644 --- a/webAO/master.js +++ b/webAO/master.js @@ -1,5 +1,5 @@ import Fingerprint2 from 'fingerprintjs2'; -import { version } from '../package.json'; +const version = process.env.npm_package_version import { unescapeChat, safe_tags } from './encoding.js'; diff --git a/webpack.config.js b/webpack.config.js index 33c639f..f692749 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,11 @@ /* 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: { @@ -39,7 +44,16 @@ module.exports = { }, ], }, - + performance: { + hints: false, + maxEntrypointSize: 512000, + maxAssetSize: 512000 + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': JSON.stringify(process.env) + }) + ], devtool: 'source-map', mode: 'production', }; |
