fix: webpack minified and bump deps

This commit is contained in:
iCrawl
2018-02-17 18:01:20 +01:00
parent 40a2f093aa
commit a7b46be923
3 changed files with 18 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "discord.js",
"version": "11.3.0",
"version": "11.3.1-dev",
"description": "A powerful library for interacting with the Discord API",
"main": "./src/index",
"types": "./typings/index.d.ts",
@@ -32,9 +32,9 @@
"homepage": "https://github.com/discordjs/discord.js#readme",
"runkitExampleFilename": "./docs/examples/ping.js",
"dependencies": {
"long": "^3.2.0",
"prism-media": "^0.0.1",
"snekfetch": "^3.6.1",
"long": "^4.0.0",
"prism-media": "^0.0.2",
"snekfetch": "^3.6.4",
"tweetnacl": "^1.0.0",
"ws": "^4.0.0"
},
@@ -48,12 +48,12 @@
"uws": "^9.14.0"
},
"devDependencies": {
"@types/node": "^8.5.7",
"@types/node": "^9.4.6",
"discord.js-docgen": "discordjs/docgen",
"eslint": "^4.15.0",
"eslint": "^4.18.0",
"parallel-webpack": "^2.2.0",
"uglifyjs-webpack-plugin": "^1.1.6",
"webpack": "^3.10.0"
"uglifyjs-webpack-plugin": "^1.2.0",
"webpack": "^3.11.0"
},
"engines": {
"node": ">=6.0.0"

View File

@@ -5,8 +5,7 @@
<meta charset="utf-8" />
</head>
<body>
<script type="text/javascript" src="../webpack/discord.js"></script>
<script type="text/javascript" src="auth.js"></script>
<script type="text/javascript" src="../webpack/discord.11.3.0.min.js"></script>
<script type="text/javascript">
(() => {
const client = window.client = new Discord.Client();

View File

@@ -19,7 +19,15 @@ const createConfig = options => {
}),
];
if (options.minify) plugins.push(new UglifyJSPlugin({ uglifyOptions: { output: { comments: false } } }));
if (options.minify) {
plugins.push(new UglifyJSPlugin({
uglifyOptions: {
mangle: { keep_classnames: true },
compress: { keep_classnames: true },
output: { comments: false },
},
}));
}
const filename = `./webpack/discord${process.env.VERSIONED === 'false' ? '' : '.' + version}${options.minify ? '.min' : ''}.js`; // eslint-disable-line