Don’t use Moment.js
Plugins can still use Discord’s Moment.js with WebpackModules
This commit is contained in:
parent
665c1d5fe4
commit
cfaf581ae1
|
@ -11,7 +11,6 @@
|
|||
import jQuery from 'jquery';
|
||||
import lodash from 'lodash';
|
||||
import Vue from 'vue';
|
||||
import moment from 'moment';
|
||||
|
||||
export { jQuery as $ };
|
||||
|
||||
|
@ -29,11 +28,6 @@ export default class {
|
|||
static get lodash() { return lodash }
|
||||
static get _() { return this.lodash }
|
||||
|
||||
/**
|
||||
* Moment
|
||||
*/
|
||||
static get moment() { return moment }
|
||||
|
||||
/**
|
||||
* Vue
|
||||
*/
|
||||
|
|
|
@ -34,7 +34,7 @@ module.exports = {
|
|||
electron: 'window.require("electron")',
|
||||
fs: 'window.require("fs")',
|
||||
path: 'window.require("path")',
|
||||
node_utils: 'window.require("util")',
|
||||
util: 'window.require("util")',
|
||||
sparkplug: 'require("../../core/dist/sparkplug")'
|
||||
},
|
||||
resolve: {
|
||||
|
|
|
@ -35,7 +35,7 @@ module.exports = {
|
|||
electron: 'window.require("electron")',
|
||||
fs: 'window.require("fs")',
|
||||
path: 'window.require("path")',
|
||||
node_utils: 'window.require("util")',
|
||||
util: 'window.require("util")',
|
||||
sparkplug: 'require("./sparkplug")'
|
||||
},
|
||||
resolve: {
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
*/
|
||||
|
||||
import { FileUtils } from './utils';
|
||||
import moment from 'moment';
|
||||
import node_utils from 'node_utils';
|
||||
import node_utils from 'util';
|
||||
|
||||
export const logLevels = {
|
||||
'log': 'log',
|
||||
|
@ -60,7 +59,7 @@ export default class Logger {
|
|||
}
|
||||
|
||||
static get timestamp() {
|
||||
return moment().format('DD/MM/YY hh:mm:ss');
|
||||
return (new Date()).toLocaleString('en-GB');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import ClientIPC from 'bdipc';
|
||||
import { ClientIPC } from 'common';
|
||||
|
||||
import { remote } from 'electron';
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ module.exports = {
|
|||
},
|
||||
externals: {
|
||||
electron: 'window.require("electron")',
|
||||
fs: 'window.require("fs")'
|
||||
fs: 'window.require("fs")',
|
||||
util: 'window.require("util")'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
|
@ -24,7 +24,8 @@ module.exports = {
|
|||
},
|
||||
externals: {
|
||||
electron: 'window.require("electron")',
|
||||
fs: 'window.require("fs")'
|
||||
fs: 'window.require("fs")',
|
||||
util: 'window.require("util")'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
|
@ -7951,11 +7951,6 @@
|
|||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.22.1",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.1.tgz",
|
||||
"integrity": "sha512-shJkRTSebXvsVqk56I+lkb2latjBs8I+pc2TzWc545y2iFnSjm7Wg0QMh+ZWcdSLQyGEau5jI8ocnmkyTgr9YQ=="
|
||||
},
|
||||
"move-concurrently": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
},
|
||||
"private": false,
|
||||
"dependencies": {
|
||||
"moment": "^2.22.1",
|
||||
"nedb": "^1.8.0",
|
||||
"node-sass": "^4.7.2"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = (Plugin, Api, Vendor) =>
|
||||
module.exports = (Plugin, Api, Vendor) =>
|
||||
|
||||
const { $, moment } = Vendor;
|
||||
const { $ } = Vendor;
|
||||
const { Events } = Api;
|
||||
|
||||
const test = 'Testing';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = (Plugin, Api, Vendor) => {
|
||||
|
||||
const { $, moment } = Vendor;
|
||||
const { $ } = Vendor;
|
||||
const { Events, Logger } = Api;
|
||||
|
||||
return class extends Plugin {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = (Plugin, Api, Vendor, Dependencies) => {
|
||||
|
||||
const { $, moment, _ } = Vendor;
|
||||
const { $, _ } = Vendor;
|
||||
const { Events, Logger, InternalSettings, CssUtils } = Api;
|
||||
|
||||
return class extends Plugin {
|
||||
|
|
Loading…
Reference in New Issue