Set ol.VERSION when creating ol package
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const pkg = require('../package.json');
|
const pkg = require('../package.json');
|
||||||
|
const version = require('../package/package.json').version;
|
||||||
|
|
||||||
const defines = {
|
const defines = {
|
||||||
'ol.ENABLE_WEBGL': false
|
'ol.ENABLE_WEBGL': false
|
||||||
@@ -118,6 +119,12 @@ module.exports = function(info, api) {
|
|||||||
// store any initial comments
|
// store any initial comments
|
||||||
const {comments} = root.find(j.Program).get('body', 0).node;
|
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 = {};
|
const replacements = {};
|
||||||
|
|
||||||
// replace all uses of defines
|
// replace all uses of defines
|
||||||
|
|||||||
Reference in New Issue
Block a user