1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

updated packages and move to webpack 4

This commit is contained in:
Kyle Spearrin
2018-09-11 23:54:39 -04:00
parent f417bb0ccf
commit aaf774308e
6 changed files with 1923 additions and 1752 deletions

2
jslib

Submodule jslib updated: d0ad865060...832babf704

3519
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{ {
"name": "bitwarden", "name": "bitwarden-browser",
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"sub:init": "git submodule update --init --recursive", "sub:init": "git submodule update --init --recursive",
@@ -21,37 +21,38 @@
"test:watch": "karma start" "test:watch": "karma start"
}, },
"devDependencies": { "devDependencies": {
"@angular/compiler-cli": "5.2.0", "@angular/compiler-cli": "^6.1.7",
"@ngtools/webpack": "1.10.2", "@ngtools/webpack": "^6.2.1",
"@types/chrome": "0.0.51", "@types/chrome": "^0.0.73",
"@types/jasmine": "^2.8.8", "@types/jasmine": "^2.8.8",
"@types/lunr": "^2.1.6", "@types/lunr": "^2.1.6",
"@types/mousetrap": "^1.6.0", "@types/mousetrap": "^1.6.0",
"@types/node": "8.0.19", "@types/node-forge": "^0.7.5",
"@types/node-forge": "0.6.10", "@types/papaparse": "^4.5.3",
"@types/papaparse": "4.1.33",
"@types/safari-extension": "^0.0.27", "@types/safari-extension": "^0.0.27",
"@types/safari-extension-content": "^0.0.14", "@types/safari-extension-content": "^0.0.14",
"@types/tldjs": "1.7.1", "@types/source-map": "0.5.2",
"@types/tldjs": "^1.7.1",
"@types/webcrypto": "^0.0.28", "@types/webcrypto": "^0.0.28",
"@types/webpack": "^4.4.11",
"angular2-template-loader": "^0.6.2", "angular2-template-loader": "^0.6.2",
"clean-webpack-plugin": "^0.1.17", "clean-webpack-plugin": "^0.1.19",
"copy-webpack-plugin": "^4.2.0", "copy-webpack-plugin": "^4.5.2",
"cross-env": "^5.1.4", "cross-env": "^5.2.0",
"css-loader": "^0.28.7", "css-loader": "^1.0.0",
"del": "3.0.0", "del": "^3.0.0",
"extract-text-webpack-plugin": "^3.0.1", "extract-text-webpack-plugin": "next",
"file-loader": "^1.1.5", "file-loader": "^2.0.0",
"gulp": "3.9.1", "gulp": "^3.9.1",
"gulp-filter": "5.0.1", "gulp-filter": "^5.1.0",
"gulp-google-webfonts": "0.0.14", "gulp-google-webfonts": "^2.0.0",
"gulp-if": "^2.0.2", "gulp-if": "^2.0.2",
"gulp-json-editor": "2.2.1", "gulp-json-editor": "^2.4.2",
"gulp-replace": "^0.6.1", "gulp-replace": "^1.0.0",
"gulp-xmlpoke": "0.2.1", "gulp-xmlpoke": "^0.2.1",
"gulp-zip": "4.0.0", "gulp-zip": "^4.2.0",
"html-loader": "^0.5.1", "html-loader": "^0.5.5",
"html-webpack-plugin": "^2.30.1", "html-webpack-plugin": "^3.2.0",
"jasmine-core": "^3.2.1", "jasmine-core": "^3.2.1",
"jasmine-spec-reporter": "^4.2.1", "jasmine-spec-reporter": "^4.2.1",
"karma": "^3.0.0", "karma": "^3.0.0",
@@ -61,41 +62,42 @@
"karma-jasmine": "^1.1.2", "karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^1.3.1", "karma-jasmine-html-reporter": "^1.3.1",
"karma-typescript": "^3.0.13", "karma-typescript": "^3.0.13",
"node-sass": "^4.9.2", "node-sass": "^4.9.3",
"sass-loader": "^6.0.6", "sass-loader": "^7.1.0",
"style-loader": "^0.19.0", "style-loader": "^0.23.0",
"ts-loader": "^3.5.0", "ts-loader": "^5.1.0",
"tslint": "^5.9.1", "tslint": "^5.11.0",
"tslint-loader": "^3.5.3", "tslint-loader": "^3.6.0",
"typescript": "^2.7.1", "typescript": "^2.7.2",
"webpack": "^3.10.0" "webpack": "^4.18.0",
"webpack-cli": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "5.2.0", "@angular/animations": "6.1.7",
"@angular/common": "5.2.0", "@angular/common": "6.1.7",
"@angular/compiler": "5.2.0", "@angular/compiler": "6.1.7",
"@angular/core": "5.2.0", "@angular/core": "6.1.7",
"@angular/forms": "5.2.0", "@angular/forms": "6.1.7",
"@angular/http": "5.2.0", "@angular/http": "6.1.7",
"@angular/platform-browser": "5.2.0", "@angular/platform-browser": "6.1.7",
"@angular/platform-browser-dynamic": "5.2.0", "@angular/platform-browser-dynamic": "6.1.7",
"@angular/router": "5.2.0", "@angular/router": "6.1.7",
"@angular/upgrade": "5.2.0", "@angular/upgrade": "6.1.7",
"@aspnet/signalr": "1.0.3", "@aspnet/signalr": "1.0.3",
"@aspnet/signalr-protocol-msgpack": "1.0.3", "@aspnet/signalr-protocol-msgpack": "1.0.3",
"angular2-toaster": "4.0.2", "angular2-toaster": "6.1.0",
"angulartics2": "5.0.1", "angulartics2": "6.3.0",
"core-js": "2.4.1", "core-js": "2.5.7",
"font-awesome": "4.7.0", "font-awesome": "4.7.0",
"lunr": "2.3.3", "lunr": "2.3.3",
"mousetrap": "1.6.1", "mousetrap": "1.6.2",
"ngx-infinite-scroll": "0.8.4", "ngx-infinite-scroll": "6.0.1",
"node-forge": "0.7.1", "node-forge": "0.7.6",
"papaparse": "4.3.5", "papaparse": "4.6.0",
"rxjs": "5.5.6", "rxjs": "6.3.2",
"sweetalert": "2.1.0", "sweetalert": "2.1.0",
"tldjs": "2.3.1", "tldjs": "2.3.1",
"web-animations-js": "2.3.1", "web-animations-js": "2.3.1",
"zone.js": "0.8.19" "zone.js": "0.8.26"
} }
} }

View File

@@ -139,7 +139,7 @@ registerLocaleData(localeZhTw, 'zh-TW');
clearQueryParams: true, clearQueryParams: true,
}, },
}), }),
ToasterModule, ToasterModule.forRoot(),
InfiniteScrollModule, InfiniteScrollModule,
], ],
declarations: [ declarations: [

View File

@@ -16,7 +16,8 @@
"jslib/*": [ "jslib/src/*" ], "jslib/*": [ "jslib/src/*" ],
"@angular/*": [ "node_modules/@angular/*" ], "@angular/*": [ "node_modules/@angular/*" ],
"angular2-toaster": [ "node_modules/angular2-toaster" ], "angular2-toaster": [ "node_modules/angular2-toaster" ],
"angulartics2": [ "node_modules/angulartics2" ] "angulartics2": [ "node_modules/angulartics2" ],
"node": [ "node_modules/@types/node" ]
} }
}, },
"exclude": [ "exclude": [

View File

@@ -11,13 +11,6 @@ if (process.env.NODE_ENV == null) {
} }
const ENV = process.env.ENV = process.env.NODE_ENV; const ENV = process.env.ENV = process.env.NODE_ENV;
const isVendorModule = (module) => {
if (!module.context) {
return false;
}
return module.context.indexOf('node_modules') !== -1;
};
const extractCss = new ExtractTextPlugin({ const extractCss = new ExtractTextPlugin({
filename: '[name].css', filename: '[name].css',
disable: false, disable: false,
@@ -72,6 +65,11 @@ const moduleRules = [
publicPath: '../', publicPath: '../',
}), }),
}, },
// Hide System.import warnings. ref: https://github.com/angular/angular/issues/21560
{
test: /[\/\\]@angular[\/\\].+\.js$/,
parser: { system: true },
},
]; ];
const plugins = [ const plugins = [
@@ -79,18 +77,8 @@ const plugins = [
path.resolve(__dirname, 'build/*'), path.resolve(__dirname, 'build/*'),
]), ]),
// ref: https://github.com/angular/angular/issues/20357 // ref: https://github.com/angular/angular/issues/20357
new webpack.ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)esm5/, new webpack.ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)fesm5/,
path.resolve(__dirname, './src')), path.resolve(__dirname, './src')),
new webpack.optimize.CommonsChunkPlugin({
name: 'popup/vendor',
chunks: ['popup/main'],
minChunks: isVendorModule,
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
chunks: ['background'],
minChunks: isVendorModule,
}),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './src/popup/index.html', template: './src/popup/index.html',
filename: 'popup/index.html', filename: 'popup/index.html',
@@ -156,6 +144,7 @@ if (ENV === 'production') {
} }
const config = { const config = {
mode: ENV,
entry: { entry: {
'popup/main': './src/popup/main.ts', 'popup/main': './src/popup/main.ts',
'background': './src/background.ts', 'background': './src/background.ts',
@@ -167,6 +156,26 @@ const config = {
'downloader/downloader': './src/downloader/downloader.ts', 'downloader/downloader': './src/downloader/downloader.ts',
'2fa/2fa': './src/2fa/2fa.ts', '2fa/2fa': './src/2fa/2fa.ts',
}, },
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'popup/vendor',
chunks: (chunk) => {
return chunk.name === 'popup/main';
},
},
commons2: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: (chunk) => {
return chunk.name === 'background';
},
},
},
},
},
resolve: { resolve: {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
alias: { alias: {