Set ol.VERSION when creating ol package

This commit is contained in:
Tim Schaub
2017-04-13 06:26:02 -06:00
parent 525fba6405
commit 4a9114cd4e

View File

@@ -1,4 +1,5 @@
const pkg = require('../package.json');
const version = require('../package/package.json').version;
const defines = {
'ol.ENABLE_WEBGL': false
@@ -118,6 +119,12 @@ module.exports = function(info, api) {
// store any initial comments
const {comments} = root.find(j.Program).get('body', 0).node;
// replace `ol.VERSION = ''` with correct version
root.find(j.ExpressionStatement, getMemberExpressionAssignment('ol.VERSION'))
.forEach(path => {
path.value.expression.right = j.literal(version);
});
const replacements = {};
// replace all uses of defines