aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-09-14 22:16:39 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-09-14 22:16:39 +0200
commit3523b64a03d677c2f8df61c121ff4fcb1d9db7f9 (patch)
tree37bfd6c76f02f2707b71b21a4e69ca3d212a26a0
parentbfb3a98fac582f104c6d9b8b7242ea2cbb650b91 (diff)
downloadPeerTube-3523b64a03d677c2f8df61c121ff4fcb1d9db7f9.tar.gz
PeerTube-3523b64a03d677c2f8df61c121ff4fcb1d9db7f9.tar.zst
PeerTube-3523b64a03d677c2f8df61c121ff4fcb1d9db7f9.zip
Optimize imports
-rw-r--r--client/config/webpack.common.js25
-rw-r--r--client/config/webpack.dev.js22
-rw-r--r--client/config/webpack.prod.js25
-rw-r--r--client/src/app/+admin/users/shared/user.service.ts2
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts2
-rw-r--r--client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts2
-rw-r--r--client/src/app/shared/rest/rest-table.ts3
-rw-r--r--client/src/app/shared/rest/rest.service.ts2
-rw-r--r--client/src/app/shared/shared.module.ts3
-rw-r--r--client/src/app/shared/video-abuse/video-abuse.service.ts2
10 files changed, 34 insertions, 54 deletions
diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js
index 7392c58d3..000699aa5 100644
--- a/client/config/webpack.common.js
+++ b/client/config/webpack.common.js
@@ -5,7 +5,6 @@ const helpers = require('./helpers')
5 */ 5 */
6 6
7const AssetsPlugin = require('assets-webpack-plugin') 7const AssetsPlugin = require('assets-webpack-plugin')
8const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
9const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') 8const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin')
10const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin') 9const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
11const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin 10const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin
@@ -297,30 +296,6 @@ module.exports = function (options) {
297 new ngcWebpack.NgcWebpackPlugin({ 296 new ngcWebpack.NgcWebpackPlugin({
298 disabled: !AOT, 297 disabled: !AOT,
299 tsConfig: helpers.root('tsconfig.webpack.json') 298 tsConfig: helpers.root('tsconfig.webpack.json')
300 }),
301
302 new BundleAnalyzerPlugin({
303 // Can be `server`, `static` or `disabled`.
304 // In `server` mode analyzer will start HTTP server to show bundle report.
305 // In `static` mode single HTML file with bundle report will be generated.
306 // In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`.
307 analyzerMode: 'static',
308 // Path to bundle report file that will be generated in `static` mode.
309 // Relative to bundles output directory.
310 reportFilename: 'report.html',
311 // Automatically open report in default browser
312 openAnalyzer: false,
313 // If `true`, Webpack Stats JSON file will be generated in bundles output directory
314 generateStatsFile: true,
315 // Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`.
316 // Relative to bundles output directory.
317 statsFilename: 'stats.json',
318 // Options for `stats.toJson()` method.
319 // For example you can exclude sources of your modules from stats file with `source: false` option.
320 // See more options here: https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21
321 statsOptions: null,
322 // Log level. Can be 'info', 'warn', 'error' or 'silent'.
323 logLevel: 'info'
324 }) 299 })
325 ], 300 ],
326 301
diff --git a/client/config/webpack.dev.js b/client/config/webpack.dev.js
index 8948af9b2..d825f40e0 100644
--- a/client/config/webpack.dev.js
+++ b/client/config/webpack.dev.js
@@ -91,28 +91,6 @@ module.exports = function (env) {
91 libraryTarget: 'var' 91 libraryTarget: 'var'
92 }, 92 },
93 93
94 module: {
95
96 // Too slow, life is short
97 // rules: [
98 // {
99 // test: /\.ts$/,
100 // use: [
101 // {
102 // loader: 'tslint-loader',
103 // options: {
104 // configFile: 'tslint.json'
105 // }
106 // }
107 // ],
108 // exclude: [
109 // /\.(spec|e2e)\.ts$/,
110 // /node_modules\//
111 // ]
112 // }
113 // ]
114 },
115
116 plugins: [ 94 plugins: [
117 95
118 /** 96 /**
diff --git a/client/config/webpack.prod.js b/client/config/webpack.prod.js
index fc47f03a0..777c816e8 100644
--- a/client/config/webpack.prod.js
+++ b/client/config/webpack.prod.js
@@ -11,6 +11,7 @@ const videoEmbedConfig = require('./webpack.video-embed.js')
11 * Webpack Plugins 11 * Webpack Plugins
12 */ 12 */
13const DefinePlugin = require('webpack/lib/DefinePlugin') 13const DefinePlugin = require('webpack/lib/DefinePlugin')
14const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
14const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') 15const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
15const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') 16const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
16const OptimizeJsPlugin = require('optimize-js-plugin') 17const OptimizeJsPlugin = require('optimize-js-plugin')
@@ -249,6 +250,30 @@ module.exports = function (env) {
249 path: helpers.root('dist') 250 path: helpers.root('dist')
250 } 251 }
251 } 252 }
253 }),
254
255 new BundleAnalyzerPlugin({
256 // Can be `server`, `static` or `disabled`.
257 // In `server` mode analyzer will start HTTP server to show bundle report.
258 // In `static` mode single HTML file with bundle report will be generated.
259 // In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`.
260 analyzerMode: 'static',
261 // Path to bundle report file that will be generated in `static` mode.
262 // Relative to bundles output directory.
263 reportFilename: 'report.html',
264 // Automatically open report in default browser
265 openAnalyzer: false,
266 // If `true`, Webpack Stats JSON file will be generated in bundles output directory
267 generateStatsFile: true,
268 // Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`.
269 // Relative to bundles output directory.
270 statsFilename: 'stats.json',
271 // Options for `stats.toJson()` method.
272 // For example you can exclude sources of your modules from stats file with `source: false` option.
273 // See more options here: https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21
274 statsOptions: null,
275 // Log level. Can be 'info', 'warn', 'error' or 'silent'.
276 logLevel: 'info'
252 }) 277 })
253 ], 278 ],
254 279
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts
index a4b89bf1d..e4bd5df37 100644
--- a/client/src/app/+admin/users/shared/user.service.ts
+++ b/client/src/app/+admin/users/shared/user.service.ts
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable'
4import 'rxjs/add/operator/catch' 4import 'rxjs/add/operator/catch'
5import 'rxjs/add/operator/map' 5import 'rxjs/add/operator/map'
6 6
7import { SortMeta } from 'primeng/primeng' 7import { SortMeta } from 'primeng/components/common/sortmeta'
8import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe' 8import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'
9 9
10import { RestExtractor, User, RestPagination, RestService } from '../../../shared' 10import { RestExtractor, User, RestPagination, RestService } from '../../../shared'
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index 73b5c0ce9..6debf89be 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -1,5 +1,5 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { SortMeta } from 'primeng/primeng' 2import { SortMeta } from 'primeng/components/common/sortmeta'
3 3
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
5 5
diff --git a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts
index 92de11f0e..654603d01 100644
--- a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts
+++ b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts
@@ -1,7 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2 2
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4import { SortMeta } from 'primeng/primeng' 4import { SortMeta } from 'primeng/components/common/sortmeta'
5 5
6import { RestTable, RestPagination, VideoAbuseService } from '../../../shared' 6import { RestTable, RestPagination, VideoAbuseService } from '../../../shared'
7import { VideoAbuse } from '../../../../../../shared' 7import { VideoAbuse } from '../../../../../../shared'
diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/shared/rest/rest-table.ts
index db2cb5e14..d04d91c68 100644
--- a/client/src/app/shared/rest/rest-table.ts
+++ b/client/src/app/shared/rest/rest-table.ts
@@ -1,4 +1,5 @@
1import { LazyLoadEvent, SortMeta } from 'primeng/primeng' 1import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent'
2import { SortMeta } from 'primeng/components/common/sortmeta'
2 3
3import { RestPagination } from './rest-pagination' 4import { RestPagination } from './rest-pagination'
4 5
diff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/shared/rest/rest.service.ts
index f7838ba06..a1c301050 100644
--- a/client/src/app/shared/rest/rest.service.ts
+++ b/client/src/app/shared/rest/rest.service.ts
@@ -1,6 +1,6 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { HttpParams } from '@angular/common/http' 2import { HttpParams } from '@angular/common/http'
3import { SortMeta } from 'primeng/primeng' 3import { SortMeta } from 'primeng/components/common/sortmeta'
4 4
5import { RestPagination } from './rest-pagination' 5import { RestPagination } from './rest-pagination'
6 6
diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts
index a28ac322d..56da62fc4 100644
--- a/client/src/app/shared/shared.module.ts
+++ b/client/src/app/shared/shared.module.ts
@@ -10,7 +10,8 @@ import { BsDropdownModule } from 'ngx-bootstrap/dropdown'
10import { ProgressbarModule } from 'ngx-bootstrap/progressbar' 10import { ProgressbarModule } from 'ngx-bootstrap/progressbar'
11import { PaginationModule } from 'ngx-bootstrap/pagination' 11import { PaginationModule } from 'ngx-bootstrap/pagination'
12import { ModalModule } from 'ngx-bootstrap/modal' 12import { ModalModule } from 'ngx-bootstrap/modal'
13import { DataTableModule, SharedModule as PrimeSharedModule } from 'primeng/primeng' 13import { DataTableModule } from 'primeng/components/datatable/datatable'
14import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared'
14 15
15import { AUTH_INTERCEPTOR_PROVIDER } from './auth' 16import { AUTH_INTERCEPTOR_PROVIDER } from './auth'
16import { RestExtractor, RestService } from './rest' 17import { RestExtractor, RestService } from './rest'
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts
index 984581114..8d979de31 100644
--- a/client/src/app/shared/video-abuse/video-abuse.service.ts
+++ b/client/src/app/shared/video-abuse/video-abuse.service.ts
@@ -4,7 +4,7 @@ import 'rxjs/add/operator/catch'
4import 'rxjs/add/operator/map' 4import 'rxjs/add/operator/map'
5import { Observable } from 'rxjs/Observable' 5import { Observable } from 'rxjs/Observable'
6 6
7import { SortMeta } from 'primeng/primeng' 7import { SortMeta } from 'primeng/components/common/sortmeta'
8 8
9import { AuthService } from '../core' 9import { AuthService } from '../core'
10import { RestExtractor, RestPagination, RestService } from '../rest' 10import { RestExtractor, RestPagination, RestService } from '../rest'