Skip to content

Commit 5baff31

Browse files
committed
ASSET_VERSIONING=query|file|none instead of env (ebook uses prod, but none)
1 parent fe27c36 commit 5baff31

15 files changed

Lines changed: 56 additions & 26 deletions

File tree

client/footer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ exports.init = function() {
55
showLinkType();
66
};
77

8-
window.footer = module.exports;
8+
//window.footer = module.exports;

client/head/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ require('./runDemo');
1818
// to ensure that other modules use exactly this (initialized) client/notify
1919
require('client/notification').init();
2020

21-
window.head = module.exports;
21+
//window.head = module.exports;

dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#export SITE_HOST=http://javascript.in
33
#export STATIC_HOST=http://javascript.in
44

5-
NODE_ENV=development WATCH=1 ./gulp dev | bunyan -o short -l debug
5+
ASSET_VERSIONING=query NODE_ENV=development WATCH=1 ./gulp dev | bunyan -o short -l debug

ebook

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3-
# CSS_NO_HASH disables hash in CSS, need for ebook
4-
CSS_NO_HASH=1 NODE_ENV=production gulp edit --harmony
3+
export ASSET_VERSIONING=none
4+
export NODE_ENV=production
55

6+
gulp client:compile-css --harmony
7+
node ./bin/server --harmony

ecosystem.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"env_production": {
1616
"NODE_ENV": "production",
1717
"SITE_HOST": "http://nightly.javascript.ru",
18-
"STATIC_HOST": "http://static-nightly.javascript.ru"
18+
"STATIC_HOST": "http://static-nightly.javascript.ru",
19+
"ASSET_VERSION": "file"
1920
}
2021
}
2122
],

edit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

3-
NODE_ENV=production gulp edit --harmony
3+
TUTORIAL_ROOT=/js/javascript-tutorial NODE_ENV=production gulp edit --harmony
44

gulpfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ gulp.task("client:livereload", lazyRequireTask("./tasks/livereload", {
6868
}));
6969

7070
gulp.task("tutorial:import:watch", lazyRequireTask('tutorial/tasks/importWatch', {
71-
root: "/js/javascript-tutorial"
71+
root: process.env.TUTORIAL_ROOT
7272
}));
7373

7474
gulp.task("test", lazyRequireTask('./tasks/test', {
@@ -112,7 +112,8 @@ gulp.task('client:compile-css',
112112
src: './styles/base.styl',
113113
dst: './public/styles',
114114
publicDst: config.server.staticHost + '/styles/', // from browser point of view
115-
manifest: path.join(config.manifestRoot, 'styles.versions.json')
115+
manifest: path.join(config.manifestRoot, 'styles.versions.json'),
116+
assetVersioning: config.assetVersioning
116117
})
117118
);
118119

hmvc/tutorial/client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ function initFolderList() {
4848
});
4949
}
5050

51-
window.tutorial = module.exports;
51+
//window.tutorial = module.exports;

hmvc/tutorial/tasks/importWatch.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@ const log = require('log')();
99
module.exports = function(options) {
1010

1111
return function(callback) {
12+
13+
if (!options.root) {
14+
throw new Error("Import watch root is not provided");
15+
}
16+
1217
var root = fs.realpathSync(options.root);
1318

19+
if (!root) {
20+
throw new Error("Import watch root does not exist " + options.root);
21+
}
22+
1423
var importer = new Importer({
1524
root: root,
1625
onchange: function(path) {

modules/config/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ module.exports = {
4141

4242
plnkrAuthId: secret.plnkrAuthId,
4343

44+
assetVersioning: env.ASSET_VERSIONING == 'file' ? 'file' :
45+
env.ASSET_VERSIONING == 'query' ? 'query' : null,
46+
4447
mailer: require('./mailer'),
4548
jade: {
4649
basedir: path.join(process.cwd(), 'templates'),

0 commit comments

Comments
 (0)