make jQuery use explicit

This commit is contained in:
JP Sugarbroad 2022-04-16 17:29:20 -07:00
parent 7674c7f693
commit 01d7ac6967
6 changed files with 4 additions and 13 deletions

@ -1,5 +1,4 @@
module.exports = { module.exports = {
setupFiles: ["./jest.setup.js"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx"], moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
transform: { transform: {
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest", "^.+\\.(js|jsx|ts|tsx)$": "babel-jest",

@ -1,2 +0,0 @@
import "regenerator-runtime/runtime";
global.$ = require("jquery");

@ -59,6 +59,7 @@
"@types/acorn": "^4.0.6", "@types/acorn": "^4.0.6",
"@types/escodegen": "^0.0.7", "@types/escodegen": "^0.0.7",
"@types/file-saver": "^2.0.3", "@types/file-saver": "^2.0.3",
"@types/jquery": "^3.5.14",
"@types/lodash": "^4.14.168", "@types/lodash": "^4.14.168",
"@types/numeral": "0.0.25", "@types/numeral": "0.0.25",
"@types/react": "^17.0.21", "@types/react": "^17.0.21",
@ -84,7 +85,6 @@
"prettier": "^2.3.2", "prettier": "^2.3.2",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"react-refresh": "^0.10.0", "react-refresh": "^0.10.0",
"regenerator-runtime": "^0.13.9",
"source-map": "^0.7.3", "source-map": "^0.7.3",
"start-server-and-test": "^1.14.0", "start-server-and-test": "^1.14.0",
"typescript": "^4.2.4", "typescript": "^4.2.4",

@ -1,3 +1,4 @@
import $ from "jquery";
import { vsprintf, sprintf } from "sprintf-js"; import { vsprintf, sprintf } from "sprintf-js";
import { getRamCost } from "./Netscript/RamCostGenerator"; import { getRamCost } from "./Netscript/RamCostGenerator";

@ -1,3 +1,5 @@
import $ from "jquery";
import { ITerminal } from "../ITerminal"; import { ITerminal } from "../ITerminal";
import { IRouter } from "../../ui/Router"; import { IRouter } from "../../ui/Router";
import { IPlayer } from "../../PersonObjects/IPlayer"; import { IPlayer } from "../../PersonObjects/IPlayer";

@ -93,15 +93,6 @@ module.exports = (env, argv) => {
new webpack.DefinePlugin({ new webpack.DefinePlugin({
"process.env.NODE_ENV": isDevelopment ? '"development"' : '"production"', "process.env.NODE_ENV": isDevelopment ? '"development"' : '"production"',
}), }),
// http://stackoverflow.com/questions/29080148/expose-jquery-to-real-window-object-with-webpack
new webpack.ProvidePlugin({
// Automtically detect jQuery and $ as free var in modules
// and inject the jquery library
// This is required by many jquery plugins
jquery: "jquery",
jQuery: "jquery",
$: "jquery",
}),
new HtmlWebpackPlugin(htmlConfig), new HtmlWebpackPlugin(htmlConfig),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: "[name].css", filename: "[name].css",