bili icon indicating copy to clipboard operation
bili copied to clipboard

Can I add footer?

Open maple3142 opened this issue 6 years ago • 4 comments

Rollup provide both output.banner and output.footer (source) But how can I add footer in bili?

maple3142 avatar Mar 17 '18 13:03 maple3142

What's the use case for footer?

Maybe we can add a configureRollup option so that you can mutate rollup config, like:

// bili.config.js
module.exports = {
	configureRollup(config) {
		config.output.footer = '// foo'
		return config
	}
}

egoist avatar Mar 17 '18 13:03 egoist

I use this to develop userscript. But I need to do some workaround for vuedraggable, so I need to wrap the whole iife with a function.

maple3142 avatar Mar 17 '18 14:03 maple3142

some workaround for vuedraggable

Can you tell me more about this?

I need to wrap the whole iife with a function

Still not sure why you need this.

egoist avatar Mar 17 '18 14:03 egoist

// @require      https://unpkg.com/[email protected]/dist/vue.runtime.min.js
// @require      https://unpkg.com/[email protected]/dist/vuex.min.js
// @require      https://unpkg.com/[email protected]/Sortable.min.js
// @require      https://cdn.jsdelivr.net/npm/vuedraggable/dist/vuedraggable.min.js


Vue.component('draggable') //=> undefined

I think it is because of

else if (window && window.Vue && window.Sortable) {
    var draggable = buildDraggable(window.Sortable);
    Vue.component('draggable', draggable);
}

So I need to use document.createElememt('script') to make it load after vue & sortablejs loaded. And execute iife after all things is loaded.

edit: I give up using vuedraggable, and try to use sortablejs directly

maple3142 avatar Mar 17 '18 14:03 maple3142