This repository has been archived by the owner on Oct 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
paths-vendor.js
136 lines (99 loc) · 2.9 KB
/
paths-vendor.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
var mainBowerFiles = require('main-bower-files');
var path = require('path');
var config = require('./config');
var srcDir = config.srcDir;
var buildDir = config.buildDir;
var bowerDir = config.bowerDir;
/*******************************************************************************
...Few words about vendor files
For not including all scripts manually we use plugin
called main-bower-files.
It returns glob of files based on "main" field in vendor packages "bower.json".
Orders of files will be as per our bower.json, so if you have some libraries
that should be loaded on first, just move them upwards in project "bower.json".
If any of files that you want to access is not listed in vendor package, you can
define files for that package manually in bower.json "overrides" field.
For more docs visit.
https://github.com/ck86/main-bower-files#main-bower-files
If for any reasons you don't like this approach, and want list your files
manually, you can just pass manual glob string or array to "src" option
eg.
export.scripts: {
src: [
bowerDir + "jquery/dist/jquery.js",
bowerDir + "angular/jquery.js",
]
}
********************************************************************************/
/***********************************************
* Vendor script files
************************************************/
var vendorSrciptFiles = mainBowerFiles({
filter: [
'**/*.js',
'!**/*.min.js'
],
paths: path.resolve(__dirname)
});
vendorSrciptFiles.push(srcDir + "/_vendor/**/*.js");
// vendorSrciptFiles.push('node_modules/babel-core/browser.js');
// vendorSrciptFiles.push('node_modules/es6-module-loader/dist/es6-module-loader-dev.js');
exports.scripts = {
src: vendorSrciptFiles,
dest: buildDir + "/js"
};
/***********************************************
* Vendor style files
************************************************/
var vendorStyleFiles = mainBowerFiles({
filter: [
'**/*.css',
'!**/*.min.css'
],
paths: path.resolve(__dirname)
});
vendorStyleFiles.push(srcDir + "/_vendor/**/*.css");
exports.styles = {
src: vendorStyleFiles,
dest: buildDir + "/css"
};
/***********************************************
* Vendor assets files
************************************************/
/*
All files which are not .js, .css, .less and fonts
*/
var vendorAssetFiles = mainBowerFiles({
filter: [
'**/*',
'!**/*.js',
'!**/*.css',
'!**/*.less',
// Ingore fonts
'!**/*.otf',
'!**/*.eot',
'!**/*.ttf',
'!**/*.woff',
'!**/*.woff2'
],
paths: path.resolve(__dirname)
});
exports.assets = {
src: vendorAssetFiles,
dest: buildDir + "/assets"
};
var vendorFontFiles = mainBowerFiles({
filter: [
'**/*.otf',
'**/*.eot',
'**/*.ttf',
'**/*.woff',
'**/*.woff2',
'**/*.svg'
],
paths: path.resolve(__dirname)
});
exports.fonts = {
src: vendorFontFiles,
dest: buildDir + "/fonts"
};