代码拉取完成,页面将自动刷新
import path from 'path';
import sourcemaps from 'rollup-plugin-sourcemaps';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
async function main()
{
const plugins = [
sourcemaps(),
resolve({
browser: true,
preferBuiltins: false,
}),
commonjs({extensions: ['.js', '.ts']}),
];
const compiled = (new Date()).toUTCString().replace(/GMT/g, 'UTC');
const sourcemap = true;
const results = [];
const pkg = require('./package.json');
const banner = [
`/*!`,
` * ${pkg.name} - v${pkg.version}`,
` * Compiled ${compiled}`,
` *`,
` * ${pkg.name} is licensed under the MIT License.`,
` * http://www.opensource.org/licenses/mit-license`,
` */`,
].join('\n');
// Check for bundle folder
const basePath = __dirname;
const input = path.join(basePath, 'src/index.js');
const freeze = false;
results.push({
input,
output: [
{
banner,
file: path.join(basePath, pkg.main),
format: 'cjs',
freeze,
sourcemap,
},
{
banner,
file: path.join(basePath, pkg.module),
format: 'es',
freeze,
sourcemap,
},
],
external: ['pixi.js'],
plugins
// plugins: [jscc({values:{_IIFE:false}})].concat(plugins)
});
// The package.json file has a bundle field
// we'll use this to generate the bundle file
// this will package all dependencies
if (pkg.bundle)
{
results.push({
input,
output: {
banner,
file: path.join(basePath, pkg.bundle),
format: 'iife',
freeze,
name: 'Nice.DrawBase',
sourcemap,
extend: true,
globals: {
'pixi.js': 'PIXI'
}
},
treeshake: false,
external: ['pixi.js'],
plugins
// plugins: [jscc({values:{_IIFE:true}})].concat(plugins),
});
}
return results;
}
export default main();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。