Browse Source

Reduces startup time

Adds webpack for bundling (disabled for now)
Uses tslib to bundle less duplicate code
main
Eric Amodio 7 years ago
parent
commit
31dd6044e6
5 changed files with 3086 additions and 74 deletions
  1. +4
    -2
      .vscodeignore
  2. +3009
    -63
      package-lock.json
  3. +11
    -8
      package.json
  4. +3
    -1
      tsconfig.json
  5. +59
    -0
      webpack.config.js

+ 4
- 2
.vscodeignore View File

@ -4,10 +4,12 @@
images/**
.vscode/**
.vscode-test/**
out/test/**
test/**
src/**
**/*.map
.github/**
.gitignore
CODE_OF_CONDUCT.md
tsconfig.json
tslint.json
tslint.json
webpack.config.js

+ 3009
- 63
package-lock.json
File diff suppressed because it is too large
View File


+ 11
- 8
package.json View File

@ -28,9 +28,6 @@
"blame",
"log",
"annotation",
"diff",
"lens",
"history",
"multi-root ready"
],
"galleryBanner": {
@ -47,7 +44,7 @@
"type": "git",
"url": "https://github.com/eamodio/vscode-gitlens.git"
},
"main": "./out/src/extension",
"main": "./out/extension",
"contributes": {
"configuration": {
"type": "object",
@ -73,7 +70,7 @@
"chorded",
"none"
],
"description": "Specifies the keymap to use for GitLens shortcut keys\n `standard` - adds a standard set of shortcut keys\n `chorded` - adds a chorded set of shortcut keys that all start with `Ctrl+Alt+G` (`⌥⌘G` on macOS)\n `none` - no shortcut keys will be added",
"description": "Specifies the keymap to use for GitLens shortcut keys\n `standard` - adds a standard set of shortcut keys\n `chorded` - adds a chorded set of shortcut keys that all start with `Ctrl+Alt+G` (`??G` on macOS)\n `none` - no shortcut keys will be added",
"scope": "window"
},
"gitlens.outputLevel": {
@ -2925,6 +2922,7 @@
"*"
],
"scripts": {
"bundle": "npm run lint && webpack --env.production",
"clean": "git clean -xdf",
"compile": "npm run lint && tsc -p ./",
"watch": "tsc -watch -p ./",
@ -2946,7 +2944,8 @@
"lodash.isequal": "4.5.0",
"lodash.once": "4.1.1",
"spawn-rx": "2.0.12",
"tmp": "0.0.33"
"tmp": "0.0.33",
"tslib": "^1.8.1"
},
"devDependencies": {
"@types/copy-paste": "1.1.30",
@ -2956,8 +2955,12 @@
"@types/tmp": "0.0.33",
"husky": "^0.14.3",
"mocha": "4.0.1",
"ts-loader": "^3.2.0",
"tslint": "5.8.0",
"typescript": "2.6.2",
"vscode": "1.1.10"
"uglifyjs-webpack-plugin": "^1.1.4",
"vscode": "1.1.10",
"webpack": "^3.10.0",
"webpack-node-externals": "^1.6.0"
}
}
}

+ 3
- 1
tsconfig.json View File

@ -1,6 +1,7 @@
{
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": [ "es2015", "es2016" ],
"module": "commonjs",
"noFallthroughCasesInSwitch": true,
@ -8,7 +9,7 @@
"noUnusedLocals": true,
"outDir": "out",
"removeComments": true,
"rootDir": ".",
"rootDir": "./src",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
@ -16,6 +17,7 @@
},
"exclude": [
"node_modules",
"test",
".vscode-test"
]
}

+ 59
- 0
webpack.config.js View File

@ -0,0 +1,59 @@
'use strict';
const webpack = require('webpack');
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = function(env, argv) {
if (env === undefined) {
env = {};
}
const minify = !!env.production;
const sourceMaps = !env.production;
const plugins = [
new UglifyJsPlugin({
parallel: true,
sourceMap: sourceMaps,
uglifyOptions: {
ecma: 7,
compress: minify,
mangle: minify,
output: {
beautify: !minify,
comments: false,
ecma: 7
},
sourceMap: sourceMaps,
}
})
];
return {
entry: './src/extension.ts',
target: 'node',
output: {
libraryTarget: 'commonjs2',
filename: 'extension.js',
path: path.resolve(__dirname, 'out')
},
resolve: {
extensions: ['.ts']
},
externals: [
nodeExternals()
],
devtool: sourceMaps ? 'inline-source-map' : false,
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
plugins: plugins
};
};

Loading…
Cancel
Save