Skip to content

Commit aed9d76

Browse files
committed
[enh] Diminution du poids total de chargement + découpe en plusieurs fichiers
1 parent 9068a5c commit aed9d76

File tree

4 files changed

+88
-94
lines changed

4 files changed

+88
-94
lines changed

brunch-config.coffee

+17-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@ module.exports = config:
1111
files:
1212
javascripts:
1313
joinTo:
14-
'vendor.js': /^node_modules/,
14+
'angular.js': /^node_modules\/@angular/,
15+
'ionic.js': /^node_modules\/(@ionic|ionic-angular)/,
16+
'types.js': /^node_modules\/@types/,
17+
'crypto.js': /^node_modules\/(tweet|scrypt)/,
18+
'vendor.js': (path) ->
19+
path.startsWith('node_modules') &&
20+
!path.startsWith('node_modules/@angular') &&
21+
!path.startsWith('node_modules/@ionic') &&
22+
!path.startsWith('node_modules/ionic') &&
23+
!path.startsWith('node_modules/@types') &&
24+
!path.startsWith('node_modules/tweet') &&
25+
!path.startsWith('node_modules/scrypt')
1526
'main.js': /^src/
1627
order:
1728
after: [/\.html$/, /\.css$/]
@@ -21,6 +32,10 @@ module.exports = config:
2132
templates: joinTo: 'templates.js'
2233

2334
plugins:
35+
uglify:
36+
mangle: true
37+
compress: true
38+
ignored: /main\.js/
2439
inlineCss: {
2540
html: true
2641
},
@@ -31,6 +46,7 @@ module.exports = config:
3146
},
3247
copycat: {
3348
"fonts" : ["node_modules/ionic-angular/fonts"],
49+
3450
verbose : false,
3551
onlyChanged: true
3652
}

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"dependencies": {
1414
"@angular/common": "4.0.0",
1515
"@angular/compiler": "4.0.0",
16-
"@angular/compiler-cli": "4.0.0",
1716
"@angular/core": "4.0.0",
1817
"@angular/forms": "4.0.0",
1918
"@angular/http": "4.0.0",

src/assets/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ <h1 style="text-align: center;">ğannonce est en cours de chargement. Veuillez p
4040

4141
<!-- The bundle js is generated during the build process -->
4242
<script src="vendor.js"></script>
43+
<script src="angular.js"></script>
44+
<script src="ionic.js"></script>
45+
<script src="crypto.js"></script>
4346
<script src="main.js"></script>
4447
<script>require('src/app/main');</script>
4548

0 commit comments

Comments
 (0)