clean up webpack/deploy stuff (#2044)

* fix stuff i think

* Update deploy.sh

* Update deploy.sh
This commit is contained in:
Gus Caplan
2017-10-22 07:45:32 -05:00
committed by Crawl
parent 296046dbc6
commit 339bcfd325
3 changed files with 17 additions and 4 deletions

View File

@@ -52,6 +52,7 @@
"discord.js-docgen": "hydrabolt/discord.js-docgen",
"eslint": "^4.0.0",
"jsdoc-strip-async-await": "^0.1.0",
"json-filter-loader": "^1.0.0",
"parallel-webpack": "^2.0.0",
"uglifyjs-webpack-plugin": "^1.0.0-beta.2",
"webpack": "^3.0.0"

View File

@@ -34,7 +34,8 @@ fi
npm run docs
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
fi

View File

@@ -3,6 +3,7 @@
DO NOT USE NORMAL WEBPACK! IT WILL NOT WORK!
*/
const path = require('path');
const webpack = require('webpack');
const createVariants = require('parallel-webpack').createVariants;
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
@@ -10,7 +11,6 @@ const version = require('./package.json').version;
const createConfig = options => {
const plugins = [
new webpack.DefinePlugin({ 'global.GENTLY': false }),
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 {
entry: './src/index.js',
output: {
path: __dirname,
path: path.resolve('./webpack'),
filename,
library: 'Discord',
libraryTarget: 'window',
@@ -36,6 +37,16 @@ const createConfig = options => {
module: {
rules: [
{ 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: {