diff --git a/package.json b/package.json index 772e608d7..bce05f1e2 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/travis/deploy.sh b/travis/deploy.sh index 9b4287294..340087312 100644 --- a/travis/deploy.sh +++ b/travis/deploy.sh @@ -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 diff --git a/webpack.config.js b/webpack.config.js index a100b1844..c1c821238 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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: {