mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
clean up webpack/deploy stuff (#2044)
* fix stuff i think * Update deploy.sh * Update deploy.sh
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
"discord.js-docgen": "hydrabolt/discord.js-docgen",
|
"discord.js-docgen": "hydrabolt/discord.js-docgen",
|
||||||
"eslint": "^4.0.0",
|
"eslint": "^4.0.0",
|
||||||
"jsdoc-strip-async-await": "^0.1.0",
|
"jsdoc-strip-async-await": "^0.1.0",
|
||||||
|
"json-filter-loader": "^1.0.0",
|
||||||
"parallel-webpack": "^2.0.0",
|
"parallel-webpack": "^2.0.0",
|
||||||
"uglifyjs-webpack-plugin": "^1.0.0-beta.2",
|
"uglifyjs-webpack-plugin": "^1.0.0-beta.2",
|
||||||
"webpack": "^3.0.0"
|
"webpack": "^3.0.0"
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ fi
|
|||||||
npm run docs
|
npm run docs
|
||||||
VERSIONED=false npm run webpack
|
VERSIONED=false npm run webpack
|
||||||
|
|
||||||
if [ $DONT_COMMIT ]; then
|
if [ $DONT_COMMIT == true ]; then
|
||||||
|
echo -e "\e[36m\e[1mNot commiting - exiting early"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
DO NOT USE NORMAL WEBPACK! IT WILL NOT WORK!
|
DO NOT USE NORMAL WEBPACK! IT WILL NOT WORK!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const createVariants = require('parallel-webpack').createVariants;
|
const createVariants = require('parallel-webpack').createVariants;
|
||||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
||||||
@@ -10,7 +11,6 @@ const version = require('./package.json').version;
|
|||||||
|
|
||||||
const createConfig = options => {
|
const createConfig = options => {
|
||||||
const plugins = [
|
const plugins = [
|
||||||
new webpack.DefinePlugin({ 'global.GENTLY': false }),
|
|
||||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -23,12 +23,13 @@ const createConfig = options => {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
const filename = `./webpack/discord${process.env.VERSIONED === 'false' ? '' : '.' + version}${options.minify ? '.min' : ''}.js`; // eslint-disable-line
|
// eslint-disable-next-line max-len
|
||||||
|
const filename = `discord${process.env.VERSIONED === 'false' ? '' : `.${version}`}${options.minify ? '.min' : ''}.js`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
output: {
|
output: {
|
||||||
path: __dirname,
|
path: path.resolve('./webpack'),
|
||||||
filename,
|
filename,
|
||||||
library: 'Discord',
|
library: 'Discord',
|
||||||
libraryTarget: 'window',
|
libraryTarget: 'window',
|
||||||
@@ -36,6 +37,16 @@ const createConfig = options => {
|
|||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{ test: /\.md$/, loader: 'ignore-loader' },
|
{ test: /\.md$/, loader: 'ignore-loader' },
|
||||||
|
{
|
||||||
|
test: require.resolve('./package.json'),
|
||||||
|
use: {
|
||||||
|
loader: 'json-filter-loader',
|
||||||
|
options: {
|
||||||
|
used: ['version', 'homepage'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
...require('snekfetch/webpack.supplemental').rules,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
|
|||||||
Reference in New Issue
Block a user