Skip to content

Commit

Permalink
[fix]时间+banner
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiao-supermap committed Jun 21, 2024
1 parent 2c5851a commit 2dfc53f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build/banner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fs from "fs";

const getVersion = function () {
const curentDate = new Date();
let month = curentDate.getMonth() + 1,
day = curentDate.getDate();
month = month < 10 ? `0${month}` : month;
day = day < 10 ? `0${day}` : day;
return `${curentDate.getFullYear()}${month}${day}`;
};

const version = JSON.parse(fs.readFileSync("package.json")).version;
export default `/*!
* forked from antvis/L7
* Copyright (c) 2018 AntV team
* Copyright© 2000-2024 SuperMap Software Co. Ltdnpm
* license: MIT
* version: ${getVersion()}
*/`;
2 changes: 2 additions & 0 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import inlineWorker from './rollup-plugin-inline-worker';
import postcss from 'rollup-plugin-postcss';
import url from 'postcss-url';
// const { visualizer } = require('rollup-plugin-visualizer');
import banner from './banner';

const { BUILD, MINIFY, TYPE } = process.env;
const minified = MINIFY === 'true';
Expand All @@ -36,6 +37,7 @@ module.exports = [
[`${TYPE}-gl`]: `${TYPE}gl`,
},
sourcemap: !production,
banner,
},
external: [`${TYPE}-gl`],
treeshake: minified,
Expand Down

0 comments on commit 2dfc53f

Please sign in to comment.