Browse Source

Bundles node_modules directly into extension.js

Updates dependencies
main
Eric Amodio 6 years ago
parent
commit
f93d8ca2db
8 changed files with 863 additions and 378 deletions
  1. +3
    -1
      .gitignore
  2. +10
    -6
      .vscodeignore
  3. +795
    -349
      package-lock.json
  4. +5
    -7
      package.json
  5. +1
    -2
      src/commands/copyMessageToClipboard.ts
  6. +1
    -2
      src/commands/copyShaToClipboard.ts
  7. +1
    -1
      src/git/remotes/provider.ts
  8. +47
    -10
      webpack.config.js

+ 3
- 1
.gitignore View File

@ -1,5 +1,7 @@
.image-cache
.cache-images
.cache-loader
dist
fallbacks
node_modules
settings.html
welcome.html

+ 10
- 6
.vscodeignore View File

@ -1,4 +1,8 @@
.image-cache/**
.cache-images/**
.cache-loader/**
.github/**
.vscode/**
dist/ui/**
emoji/**
!images/dark/**
!images/light/**
@ -7,16 +11,16 @@ emoji/**
!images/gitlens-activitybar.svg
!images/cl-*.png
images/**
.vscode/**
test/**
node_modules/**
src/**
dist/ui/**
test/**
*.map
.github/**
.gitignore
.rpt2_cache/**
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
package-lock.json
tsconfig.json
tslint.json
ui.tsconfig.json
webpack.config.js

+ 795
- 349
package-lock.json
File diff suppressed because it is too large
View File


+ 5
- 7
package.json View File

@ -3577,7 +3577,7 @@
"scripts": {
"build": "webpack --env.development",
"bundle": "webpack --env.production",
"clean": "git clean -Xdf",
"clean": "git clean -Xdf -e !.cache-images",
"lint": "tslint --project tsconfig.json && tslint --project ui.tsconfig.json",
"pack": "vsce package",
"pretty": "prettier --config .prettierrc --loglevel warn --write \"./**/*.{ts,md,json}\" && tslint --project tsconfig.json --fix && tslint --project ui.tsconfig.json --fix",
@ -3603,9 +3603,9 @@
"@types/node": "8.10.29",
"clean-webpack-plugin": "0.1.19",
"css-loader": "1.0.0",
"filemanager-webpack-plugin": "2.0.5",
"html-webpack-inline-source-plugin": "0.0.10",
"html-webpack-plugin": "3.2.0",
"husky": "0.14.3",
"imagemin-webpack-plugin": "2.2.0",
"mini-css-extract-plugin": "0.4.2",
"node-sass": "4.9.3",
@ -3613,16 +3613,14 @@
"prettier-tslint": "0.4.0",
"sass-loader": "7.1.0",
"size-plugin": "1.0.1",
"style-loader": "0.23.0",
"tslint": "5.11.0",
"tslint-loader": "3.6.0",
"tslint-prettiest": "0.0.1",
"ts-loader": "5.0.0",
"ts-loader": "5.1.0",
"typescript": "3.0.3",
"vscode": "1.1.21",
"webpack": "4.17.2",
"webpack": "4.18.0",
"webpack-cli": "3.1.0",
"webpack-deep-scope-plugin": "1.5.3",
"webpack-node-externals": "1.7.2"
"webpack-deep-scope-plugin": "1.6.0"
}
}

+ 1
- 2
src/commands/copyMessageToClipboard.ts View File

@ -1,4 +1,5 @@
'use strict';
import * as clipboard from 'clipboardy';
import { TextEditor, Uri, window } from 'vscode';
import { Container } from '../container';
import { GitUri } from '../git/gitService';
@ -30,8 +31,6 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
uri = getCommandUri(uri, editor);
try {
const clipboard = await import('clipboardy');
args = { ...args };
// If we don't have an editor then get the message of the last commit to the branch

+ 1
- 2
src/commands/copyShaToClipboard.ts View File

@ -1,4 +1,5 @@
'use strict';
import * as clipboard from 'clipboardy';
import { TextEditor, Uri, window } from 'vscode';
import { Container } from '../container';
import { GitUri } from '../git/gitService';
@ -29,8 +30,6 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
uri = getCommandUri(uri, editor);
try {
const clipboard = await import('clipboardy');
args = { ...args };
// If we don't have an editor then get the sha of the last commit to the branch

+ 1
- 1
src/git/remotes/provider.ts View File

@ -1,4 +1,5 @@
'use strict';
import * as clipboard from 'clipboardy';
import { commands, Range, Uri, window } from 'vscode';
import { BuiltInCommands } from '../../constants';
import { Logger } from '../../logger';
@ -118,7 +119,6 @@ export abstract class RemoteProvider {
if (url === undefined) return undefined;
try {
const clipboard = await import('clipboardy');
void (await clipboard.write(url));
return undefined;

+ 47
- 10
webpack.config.js View File

@ -1,8 +1,10 @@
'use strict';
const fs = require('fs');
const glob = require('glob');
const nodeExternals = require('webpack-node-externals');
const path = require('path');
const webpack = require('webpack');
const CleanPlugin = require('clean-webpack-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin');
const HtmlInlineSourcePlugin = require('html-webpack-inline-source-plugin');
const HtmlPlugin = require('html-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
@ -14,16 +16,46 @@ module.exports = function(env, argv) {
env = env || {};
env.production = !!env.production;
env.optimizeImages = env.production || !!env.optimizeImages;
env.copyClipboardyFallbacks = env.production || !!env.copyClipboardyFallbacks;
if (!env.copyClipboardyFallbacks && !fs.existsSync(path.resolve(__dirname, 'fallbacks'))) {
env.copyClipboardyFallbacks = true;
}
return [getExtensionConfig(env), getUIConfig(env)];
};
function getExtensionConfig(env) {
const clean = ['dist'];
if (env.copyClipboardyFallbacks) {
clean.push('fallbacks');
}
const plugins = [
// https://github.com/GoogleChromeLabs/size-plugin/issues/12
// new SizePlugin(),
new CleanPlugin(['dist'], { verbose: false })
new CleanPlugin(clean, { verbose: false }),
new webpack.IgnorePlugin(/^spawn-sync$/)
];
if (env.copyClipboardyFallbacks) {
plugins.push(
// @ts-ignore
new FileManagerPlugin({
onEnd: [
{
copy: [
{
source: path.resolve(__dirname, 'node_modules/clipboardy/fallbacks'),
destination: 'fallbacks/'
}
]
}
]
})
);
}
// if (env.production) {
// plugins.push(new WebpackDeepScopeAnalysisPlugin());
// }
@ -33,6 +65,9 @@ function getExtensionConfig(env) {
entry: './src/extension.ts',
mode: env.production ? 'production' : 'development',
target: 'node',
node: {
__dirname: false
},
devtool: !env.production ? 'eval-source-map' : undefined,
output: {
libraryTarget: 'commonjs2',
@ -40,10 +75,9 @@ function getExtensionConfig(env) {
path: path.resolve(__dirname, 'dist'),
devtoolModuleFilenameTemplate: 'file:///[absolute-resource-path]'
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
externals: {
vscode: 'commonjs vscode'
},
externals: [nodeExternals()],
module: {
rules: [
{
@ -58,6 +92,9 @@ function getExtensionConfig(env) {
}
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
plugins: plugins,
stats: {
all: false,
@ -133,7 +170,7 @@ function getUIConfig(env) {
sources: glob.sync('src/ui/images/settings/*.png'),
destination: path.resolve(__dirname, 'images')
},
cacheFolder: path.resolve(__dirname, '.image-cache'),
cacheFolder: path.resolve(__dirname, '.cache-images'),
gifsicle: null,
jpegtran: null,
optipng: null,
@ -177,10 +214,6 @@ function getUIConfig(env) {
}
}
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
modules: [path.resolve(__dirname, 'src/ui'), 'node_modules']
},
module: {
rules: [
{
@ -230,6 +263,10 @@ function getUIConfig(env) {
}
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
modules: [path.resolve(__dirname, 'src/ui'), 'node_modules']
},
plugins: plugins,
stats: {
all: false,

Loading…
Cancel
Save