From 8e1fa8562f9e9cc388c737be1c8bd79b0d4b6c84 Mon Sep 17 00:00:00 2001 From: Mosh Feu Date: Fri, 18 Sep 2020 03:03:32 +0300 Subject: [PATCH] chore: reduce bundle - remove externals --- package.json | 5 +++-- webpack.config.js | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9817af8..02f777c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "git-wiz", - "version": "1.1.2", + "version": "1.1.3", "author": { "email": "moshfeu.dev@gmail.com", "name": "Mosh Feu", @@ -31,6 +31,7 @@ "@types/inquirer": "^7.3.1", "json-loader": "^0.5.7", "webpack": "^4.44.1", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "webpack-node-externals": "^2.5.2" } } diff --git a/webpack.config.js b/webpack.config.js index 5aced31..e13f8e0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,6 @@ const path = require('path'); const webpack = require('webpack'); +const nodeExternals = require('webpack-node-externals'); module.exports = { entry: './src/index.ts', @@ -14,13 +15,14 @@ module.exports = { ], }, resolve: { - extensions: [ '.ts', '.js' ], + extensions: ['.ts', '.js'], }, output: { filename: 'index.js', path: path.resolve(__dirname, 'bin'), }, + externals: [nodeExternals()], plugins: [ - new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }), - ] + new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }), + ], };