Bug 1310417 - use shams for devtools.js dependencies unable to run in content
MozReview-Commit-ID: LKtzQoJBJLr
new file mode 100644
--- /dev/null
+++ b/devtools/client/shared/shim/about-devtools-sham.js
@@ -0,0 +1,12 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+module.exports = {
+ register: () => {},
+ unregister: () => {},
+};
new file mode 100644
--- /dev/null
+++ b/devtools/client/shared/shim/jsonview-sham.js
@@ -0,0 +1,14 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+module.exports = {
+ JsonView: {
+ initialize: () => {},
+ destroy: () => {},
+ }
+};
new file mode 100644
--- /dev/null
+++ b/devtools/client/shared/shim/system-unload-sham.js
@@ -0,0 +1,11 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+module.exports = {
+ when: () => {},
+};
--- a/devtools/client/webpack.config.js
+++ b/devtools/client/webpack.config.js
@@ -1,14 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
+/* globals __dirname */
+
const path = require("path");
const webpack = require("webpack");
module.exports = [{
bail: true,
entry: [
"./sourceeditor/codemirror/addon/dialog/dialog.js",
"./sourceeditor/codemirror/addon/search/searchcursor.js",
@@ -77,36 +79,46 @@ module.exports = [{
path.resolve("./node_modules"),
path.resolve("./webpack"),
]
},
resolve: {
alias: {
"devtools/shared/locales": path.join(__dirname, "../shared/locales/en-US"),
"devtools/client/locales": path.join(__dirname, "./locales/en-US"),
- "toolkit/locales": path.join(__dirname, "../../toolkit/locales/en-US/chrome/global"),
+ "toolkit/locales":
+ path.join(__dirname, "../../toolkit/locales/en-US/chrome/global"),
"devtools/shared/platform": path.join(__dirname, "../shared/platform/content"),
+ Services: path.join(__dirname, "./shared/shim/Services.js"),
+ "devtools/client/jsonview/main":
+ path.join(__dirname, "./shared/shim/jsonview-sham.js"),
+ "sdk/system/unload": path.join(__dirname, "./shared/shim/system-unload-sham.js"),
+ "devtools/client/framework/about-devtools-toolbox":
+ path.join(__dirname, "./shared/shim/about-devtools-sham.js"),
devtools: path.join(__dirname, "../"),
- Services: path.join(__dirname, "./shared/shim/Services.js"),
gcli: path.join(__dirname, "../shared/gcli/source/lib/gcli"),
acorn: path.join(__dirname, "../shared/acorn"),
"acorn/util/walk": path.join(__dirname, "../shared/acorn/walk"),
sdk: path.join(__dirname, "../../addon-sdk/source/lib/sdk"),
method: path.join(__dirname, "../../addon-sdk/source/lib/method"),
"modules/libpref/init/all": path.join(__dirname,
"../../modules/libpref/init/all.js"),
},
},
plugins: [
new webpack.DefinePlugin({
"isWorker": JSON.stringify(false),
"reportError": "console.error",
"AppConstants": "{ DEBUG: true, DEBUG_JS_MODULES: true }",
- "loader": "{ lazyRequireGetter: () => {}, lazyGetter: () => {}, chromeRequire: () => {} }",
+ "loader": `{
+ lazyRequireGetter: () => {},
+ lazyGetter: () => {},
+ chromeRequire: () => {}
+ }`,
"dump": "console.log",
}),
],
externals: [
/codemirror\//,
{
"promise": "var Promise",