Skip to content

Commit caee0af

Browse files
committed
Bootstrap version update
Migrate a few libraries from bower to npm Install vendor dependencies via npm
1 parent cd073b5 commit caee0af

File tree

5 files changed

+238
-35
lines changed

5 files changed

+238
-35
lines changed

build/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ var path = require('path');
22

33
module.exports = {
44
rootDir: "../", // Root dir
5-
srcDir: path.resolve("../src"), // Source files
5+
srcDir: path.resolve("../src"), // Source files
66
destDir: path.resolve("../dist"), // Build destination
77
bowerDir: "../bower_components", // Bower dir
8-
npmDir: "../node_modules", // Npm dir
8+
npmDir: path.resolve("../node_modules"), // Npm dir
99
port: 4000
10-
};
10+
};

build/paths/vendor.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ var bowerDir = config.bowerDir;
1212
/*******************************************************************************
1313
1414
...Few words about vendor files
15-
15+
1616
For not including all scripts manually we use plugin
17-
called main-bower-files.
17+
called main-bower-files.
1818
1919
It returns glob of files based on "main" field in vendor packages "bower.json".
2020
Orders of files will be as per our bower.json, so if you have some libraries
2121
that should be loaded on first, just move them upwards in project "bower.json".
2222
23-
If any of files that you want to access is not listed in vendor package, you can
23+
If any of files that you want to access is not listed in vendor package, you can
2424
define files for that package manually in bower.json "overrides" field.
2525
2626
For more docs visit.
@@ -29,7 +29,7 @@ var bowerDir = config.bowerDir;
2929
If for any reasons you don't like this approach, and want list your files
3030
manually, you can just pass manual glob string or array to "src" option
3131
32-
eg.
32+
eg.
3333
3434
export.scripts: [
3535
bowerDir + "jquery/dist/jquery.js",
@@ -43,16 +43,32 @@ var bowerDir = config.bowerDir;
4343
/***********************************************
4444
* Vendor script files
4545
************************************************/
46-
4746

48-
exports.scripts = mainBowerFiles({
47+
var npmScripts = [
48+
config.npmDir + '/jquery/dist/jquery.js',
49+
config.npmDir + '/jquery-flot/jquery.flot.js',
50+
config.npmDir + '/jquery-flot/jquery.flot.resize.js',
51+
config.npmDir + '/jquery-flot/jquery.flot.pie.js',
52+
config.npmDir + '/jquery-flot/jquery.flot.time.js',
53+
config.npmDir + '/jquery.flot.tooltip/js/jquery.flot.tooltip.js',
54+
];
55+
56+
var bowerScripts = mainBowerFiles({
4957
filter: [
5058
'**/*.js',
5159
'!**/*.min.js'
5260
],
5361
paths: rootDir
5462
});
5563

64+
bowerScripts.splice(0, npmScripts.length);
65+
66+
var scripts = [].concat(npmScripts, bowerScripts);
67+
68+
console.log(scripts);
69+
70+
exports.scripts = scripts;
71+
5672

5773
/***********************************************
5874
* Vendor style files
@@ -83,7 +99,7 @@ var bowerDir = config.bowerDir;
8399
'!**/*.less',
84100

85101
// Ingore fonts
86-
102+
87103
'!**/*.otf',
88104
'!**/*.eot',
89105
'!**/*.ttf',
@@ -108,4 +124,4 @@ var bowerDir = config.bowerDir;
108124
'**/*.svg'
109125
],
110126
paths: rootDir
111-
});
127+
});

0 commit comments

Comments
 (0)