Fix RAGE client-side export definition
This commit is contained in:
parent
ce551c2afe
commit
f724e9dc91
2
dist/rage-rpc.min.js
vendored
2
dist/rage-rpc.min.js
vendored
File diff suppressed because one or more lines are too long
6
package-lock.json
generated
6
package-lock.json
generated
@ -4161,6 +4161,12 @@
|
|||||||
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
|
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"replace-in-file-webpack-plugin": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/replace-in-file-webpack-plugin/-/replace-in-file-webpack-plugin-1.0.6.tgz",
|
||||||
|
"integrity": "sha512-+KRgNYL2nbc6nza6SeF+wTBNkovuHFTfJF8QIEqZg5MbwkYpU9no0kH2YU354wvY/BK8mAC2UKoJ7q+sJTvciw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"require-directory": {
|
"require-directory": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rage-rpc",
|
"name": "rage-rpc",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "An asynchronous RPC implementation for RAGE Multiplayer",
|
"description": "An asynchronous RPC implementation for RAGE Multiplayer",
|
||||||
"main": "dist/rage-rpc.min.js",
|
"main": "dist/rage-rpc.min.js",
|
||||||
"types": "dist/rage-rpc.d.ts",
|
"types": "dist/rage-rpc.d.ts",
|
||||||
@ -27,6 +27,7 @@
|
|||||||
"@babel/preset-env": "^7.2.3",
|
"@babel/preset-env": "^7.2.3",
|
||||||
"@babel/preset-typescript": "^7.1.0",
|
"@babel/preset-typescript": "^7.1.0",
|
||||||
"babel-loader": "^8.0.5",
|
"babel-loader": "^8.0.5",
|
||||||
|
"replace-in-file-webpack-plugin": "^1.0.6",
|
||||||
"typescript": "^3.2.2",
|
"typescript": "^3.2.2",
|
||||||
"webpack": "^4.23.1",
|
"webpack": "^4.23.1",
|
||||||
"webpack-cli": "^3.1.2"
|
"webpack-cli": "^3.1.2"
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
|
||||||
|
|
||||||
|
const LIBRARY_NAME = 'rpc';
|
||||||
|
const OUTPUT_FILE = 'rage-rpc.min.js';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/index.ts',
|
entry: './src/index.ts',
|
||||||
@ -16,9 +20,19 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'rage-rpc.min.js',
|
filename: OUTPUT_FILE,
|
||||||
library: 'rpc',
|
library: LIBRARY_NAME,
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
globalObject: "typeof self !== 'undefined' ? self : this"
|
globalObject: "typeof self !== 'undefined' ? self : this"
|
||||||
}
|
},
|
||||||
|
plugins: [
|
||||||
|
new ReplaceInFileWebpackPlugin([{
|
||||||
|
dir: 'dist',
|
||||||
|
files: [OUTPUT_FILE],
|
||||||
|
rules: [{
|
||||||
|
search: `exports.${LIBRARY_NAME}`,
|
||||||
|
replace: 'exports'
|
||||||
|
}]
|
||||||
|
}])
|
||||||
|
]
|
||||||
};
|
};
|
Reference in New Issue
Block a user