代码拉取完成,页面将自动刷新
同步操作将从 小闫同学/gantt-schedule-timeline-calendar 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import typescript from 'rollup-plugin-typescript';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import stylusLib from 'stylus';
import { readFileSync, writeFileSync } from 'fs';
function stylus() {
let result = '';
let output = '';
return {
name: 'stylus',
outputOptions(options) {
output = options.file;
},
resolveId(source) {
if (source.endsWith('.styl')) {
return source;
}
return null;
},
load(id) {
if (id.endsWith('.styl')) {
const style = readFileSync(id, { encoding: 'utf8' });
stylusLib.render(style, function(err, css) {
if (err) throw err;
result = css;
});
return 'var stylus=1;';
}
return null; // other ids should be handled as usually
},
writeBundle(bundle) {
writeFileSync(output, result, { encoding: 'utf8' });
}
};
}
const production = !process.env.ROLLUP_WATCH;
const devFiles = [
{
input: 'src/index.ts',
output: {
sourcemap: true,
file: 'dist/index.umd.js',
format: 'umd',
name: 'GSTC'
},
//context: 'null',
//moduleContext: 'null',
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
!production && livereload('dist')
]
},
{
input: 'src/index.ts',
output: {
sourcemap: true,
file: 'dist/index.esm.js',
format: 'esm'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] })
]
},
{
input: 'src/plugins/ItemMovement.plugin.ts',
output: {
sourcemap: true,
file: 'dist/ItemMovement.plugin.js',
format: 'umd',
name: 'ItemMovement'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] })
]
},
{
input: 'src/plugins/ItemHold.plugin.ts',
output: {
sourcemap: true,
file: 'dist/ItemHold.plugin.js',
format: 'umd',
name: 'ItemHold'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] })
]
},
{
input: 'src/plugins/Selection.plugin.ts',
output: {
sourcemap: true,
file: 'dist/Selection.plugin.js',
format: 'umd',
name: 'Selection'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] })
]
},
{
input: 'src/plugins/CalendarScroll.plugin.ts',
output: {
sourcemap: true,
file: 'dist/CalendarScroll.plugin.js',
format: 'umd',
name: 'CalendarScroll'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] })
]
},
{
input: 'src/plugins/WeekendHighlight.plugin.ts',
output: {
sourcemap: true,
file: 'dist/WeekendHighlight.plugin.js',
format: 'umd',
name: 'WeekendHighlight'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] })
]
},
{
input: 'src/plugins/plugins.ts',
output: {
sourcemap: true,
file: 'dist/plugins.js',
format: 'esm',
name: 'plugins'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] })
]
},
{
input: 'src/style.styl',
output: { format: 'esm', file: 'dist/style.css' },
plugins: [stylus()]
}
];
const prodFiles = Array.prototype.concat(devFiles, [
{
input: 'src/index.ts',
output: {
sourcemap: false,
file: 'dist/index.umd.min.js',
format: 'umd',
name: 'GSTC'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
keep_classnames: true,
keep_fnames: true,
output: { comments: false }
})
]
},
{
input: 'src/index.ts',
output: {
sourcemap: false,
file: 'dist/index.esm.min.js',
format: 'esm'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
//keep_classnames: true,
//keep_fnames: true,
output: { comments: false }
})
]
},
{
input: 'src/plugins/ItemMovement.plugin.ts',
output: {
sourcemap: false,
file: 'dist/ItemMovement.plugin.min.js',
format: 'umd',
name: 'ItemMovement'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
//keep_classnames: true,
//keep_fnames: true,
output: { comments: false }
})
]
},
{
input: 'src/plugins/ItemHold.plugin.ts',
output: {
sourcemap: false,
file: 'dist/ItemHold.plugin.min.js',
format: 'umd',
name: 'ItemHold'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
//keep_classnames: true,
//keep_fnames: true,
output: { comments: false }
})
]
},
{
input: 'src/plugins/Selection.plugin.ts',
output: {
sourcemap: false,
file: 'dist/Selection.plugin.min.js',
format: 'umd',
name: 'Selection'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
//keep_classnames: true,
//keep_fnames: true,
output: { comments: false }
})
]
},
{
input: 'src/plugins/CalendarScroll.plugin.ts',
output: {
sourcemap: false,
file: 'dist/CalendarScroll.plugin.min.js',
format: 'umd',
name: 'CalendarScroll'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
//keep_classnames: true,
//keep_fnames: true,
output: { comments: false }
})
]
},
{
input: 'src/plugins/WeekendHighlight.plugin.ts',
output: {
sourcemap: false,
file: 'dist/WeekendHighlight.plugin.min.js',
format: 'umd',
name: 'WeekendHighlight'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
//keep_classnames: true,
//keep_fnames: true,
output: { comments: false }
})
]
},
{
input: 'src/plugins/plugins.ts',
output: {
sourcemap: false,
file: 'dist/plugins.min.js',
format: 'esm',
name: 'plugins'
},
plugins: [
typescript({ target: 'es6' }),
resolve({
browser: true
}),
commonjs({ extensions: ['.js', '.ts'] }),
terser({
//keep_classnames: true,
//keep_fnames: true,
output: { comments: false }
})
]
}
]);
const files = production ? prodFiles : devFiles;
export default files;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。