1 Star 1 Fork 0

耿直/widget-qrcode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.mjs 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
PASSER-BY 提交于 2024-05-16 01:50 . updated 初始版本添加
import resolve from '@rollup/plugin-node-resolve'; // 使用node_modules包
import terser from '@rollup/plugin-terser'; // 代码压缩
import babel from '@rollup/plugin-babel'; // ECMAScript兼容
import {importAssertionsPlugin} from 'rollup-plugin-import-assert';
import {importAssertions} from 'acorn-import-assertions';
import pkg from './package.json' assert { type:'json' }; // 获取package信息
// 版权信息
const repository = pkg.repository.url.replace(/(.+)(:\/\/.+)\.git$/,'https$2');
const now = new Date();
const date = (new Date(now.getTime()-now.getTimezoneOffset()*60000)).toISOString().substring(0,10);
const banner = `/*!
* ${pkg.name} v${pkg.version}
* ${pkg.description}
* ${pkg.homepage}
*
* Copyright (c) 2024-present, ${pkg.author}
*
* Released under the ${pkg.license} License
* ${repository}
*
* Created on: ${date}
*/`;
const commonPlugins = [
resolve(),
importAssertionsPlugin(),
terser(),
babel({
babelHelpers: 'runtime',
exclude:'node_modules/**'
})
];
export default [{
input: './src/widget-qrcode.js',
output:[{
file: './dist/widget-qrcode.min.js',
format: 'iife',
banner
}],
acornInjectPlugins: [ importAssertions ],
plugins: commonPlugins,
watch: {
exclude: 'node_modules/**'
}
}];
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ciqiu/widget-qrcode.git
git@gitee.com:ciqiu/widget-qrcode.git
ciqiu
widget-qrcode
widget-qrcode
main

搜索帮助