You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-30 23:44:55 +02:00
Mobile: Fixed mobile build
This commit is contained in:
@ -4,7 +4,7 @@ import Joplin from './Joplin';
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
const builtinModules = require('builtin-modules');
|
||||
// const builtinModules = require('builtin-modules');
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
@ -12,7 +12,7 @@ const builtinModules = require('builtin-modules');
|
||||
export default class Global {
|
||||
|
||||
private joplin_: Joplin;
|
||||
private requireWhiteList_: string[] = null;
|
||||
// private requireWhiteList_: string[] = null;
|
||||
// private consoleWrapper_:any = null;
|
||||
|
||||
constructor(implementation: any, plugin: Plugin, store: any) {
|
||||
@ -40,22 +40,22 @@ export default class Global {
|
||||
return this.joplin_;
|
||||
}
|
||||
|
||||
private requireWhiteList(): string[] {
|
||||
if (!this.requireWhiteList_) {
|
||||
this.requireWhiteList_ = builtinModules.slice();
|
||||
this.requireWhiteList_.push('fs-extra');
|
||||
}
|
||||
return this.requireWhiteList_;
|
||||
}
|
||||
// private requireWhiteList(): string[] {
|
||||
// if (!this.requireWhiteList_) {
|
||||
// this.requireWhiteList_ = builtinModules.slice();
|
||||
// this.requireWhiteList_.push('fs-extra');
|
||||
// }
|
||||
// return this.requireWhiteList_;
|
||||
// }
|
||||
|
||||
// get console(): any {
|
||||
// return this.consoleWrapper_;
|
||||
// }
|
||||
|
||||
require(filePath: string): any {
|
||||
if (!this.requireWhiteList().includes(filePath)) throw new Error(`Path not allowed: ${filePath}`);
|
||||
return require(filePath);
|
||||
}
|
||||
// require(filePath: string): any {
|
||||
// if (!this.requireWhiteList().includes(filePath)) throw new Error(`Path not allowed: ${filePath}`);
|
||||
// return require(filePath);
|
||||
// }
|
||||
|
||||
// To get webpack to work with Node module we need to set the parameter `target: "node"`, however
|
||||
// when setting this, the code generated by webpack will try to access the `process` global variable,
|
||||
|
Reference in New Issue
Block a user