mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Standardised module loading system & fixed build system
Fixed broken build system in broken webpack version. Also updates module system to standardise on ES6 import/exports, Especially since babel has changed it's 'default' logic for the old module system.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
const draggable = require('vuedraggable');
|
||||
const dropzone = require('./components/dropzone');
|
||||
import draggable from "vuedraggable";
|
||||
import dropzone from "./components/dropzone";
|
||||
|
||||
function mounted() {
|
||||
this.pageId = this.$el.getAttribute('page-id');
|
||||
@ -137,6 +137,6 @@ let methods = {
|
||||
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
data, methods, mounted, components,
|
||||
};
|
@ -1,4 +1,4 @@
|
||||
const codeLib = require('../services/code');
|
||||
import codeLib from "../services/code";
|
||||
|
||||
const methods = {
|
||||
show() {
|
||||
@ -37,7 +37,7 @@ const data = {
|
||||
callback: null
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
methods,
|
||||
data
|
||||
};
|
@ -125,4 +125,4 @@ const methods = {
|
||||
|
||||
};
|
||||
|
||||
module.exports = {template, data, props, methods};
|
||||
export default {template, data, props, methods};
|
@ -1,4 +1,4 @@
|
||||
const DropZone = require("dropzone");
|
||||
import DropZone from "dropzone";
|
||||
|
||||
const template = `
|
||||
<div class="dropzone-container">
|
||||
@ -60,7 +60,7 @@ const methods = {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
template,
|
||||
props,
|
||||
mounted,
|
||||
|
@ -39,6 +39,6 @@ function mounted() {
|
||||
this.type = this.$el.getAttribute('entity-type');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
data, computed, methods, mounted
|
||||
};
|
@ -1,7 +1,5 @@
|
||||
|
||||
import * as Dates from "../services/dates";
|
||||
|
||||
const dropzone = require('./components/dropzone');
|
||||
import dropzone from "./components/dropzone";
|
||||
|
||||
let page = 0;
|
||||
let previousClickTime = 0;
|
||||
@ -193,7 +191,7 @@ function mounted() {
|
||||
baseUrl = window.baseUrl('/images/' + this.imageType + '/all/')
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
mounted,
|
||||
methods,
|
||||
data,
|
||||
|
@ -145,6 +145,6 @@ let computed = {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
mounted, data, methods, computed,
|
||||
};
|
@ -188,6 +188,6 @@ function created() {
|
||||
this.dateParse(this.termString);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
data, computed, methods, created
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
const draggable = require('vuedraggable');
|
||||
const autosuggest = require('./components/autosuggest');
|
||||
import draggable from 'vuedraggable';
|
||||
import autosuggest from './components/autosuggest';
|
||||
|
||||
let data = {
|
||||
entityId: false,
|
||||
@ -63,6 +63,6 @@ function mounted() {
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
data, methods, mounted, components, directives
|
||||
};
|
@ -1,17 +1,25 @@
|
||||
const Vue = require("vue");
|
||||
import Vue from "vue";
|
||||
|
||||
function exists(id) {
|
||||
return document.getElementById(id) !== null;
|
||||
}
|
||||
|
||||
import searchSystem from "./search";
|
||||
import entityDashboard from "./entity-dashboard";
|
||||
import codeEditor from "./code-editor";
|
||||
import imageManager from "./image-manager";
|
||||
import tagManager from "./tag-manager";
|
||||
import attachmentManager from "./attachment-manager";
|
||||
import pageEditor from "./page-editor";
|
||||
|
||||
let vueMapping = {
|
||||
'search-system': require('./search'),
|
||||
'entity-dashboard': require('./entity-dashboard'),
|
||||
'code-editor': require('./code-editor'),
|
||||
'image-manager': require('./image-manager'),
|
||||
'tag-manager': require('./tag-manager'),
|
||||
'attachment-manager': require('./attachment-manager'),
|
||||
'page-editor': require('./page-editor'),
|
||||
'search-system': searchSystem,
|
||||
'entity-dashboard': entityDashboard,
|
||||
'code-editor': codeEditor,
|
||||
'image-manager': imageManager,
|
||||
'tag-manager': tagManager,
|
||||
'attachment-manager': attachmentManager,
|
||||
'page-editor': pageEditor,
|
||||
};
|
||||
|
||||
window.vues = {};
|
||||
|
Reference in New Issue
Block a user