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
|
// Config file for running Rollup in "normal" mode (non-watch)
const json = require('@rollup/plugin-json')
const pkg = require('../package.json')
let {version} = pkg;
let release;
// Skip the git branch+rev in the banner when doing a release build
if (process.env.NODE_ENV === 'release') {
release = true;
} else {
release = false;
const branch = gitRev.branch();
const rev = gitRev.short();
version += '+' + branch + '.' + rev;
}
const banner = `/* @preserve
* Leaflet ${version}, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
`;
const outro = `var oldL = window.L;
exports.noConflict = function() {
window.L = oldL;
return this;
}
// Always export us to window global (see #2364)
window.L = exports;`;
module.exports = {
input: 'src/Leaflet.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'L',
banner: banner,
outro: outro,
sourcemap: true,
legacy: true, // Needed to create files loadable by IE8
freeze: false
},
{
file: 'dist/leaflet-src.esm.js',
format: 'es',
banner: banner,
sourcemap: true,
freeze: false
}
],
plugins: [
release ? json() : rollupGitVersion()
]
};
|