--- a/devtools/client/webpack.config.js
+++ b/devtools/client/webpack.config.js
@@ -1,14 +1,17 @@
/* 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";
+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",
"./sourceeditor/codemirror/addon/search/search.js",
"./sourceeditor/codemirror/addon/edit/matchbrackets.js",
"./sourceeditor/codemirror/addon/edit/closebrackets.js",
@@ -31,9 +34,113 @@ module.exports = [{
"./sourceeditor/codemirror/addon/fold/foldgutter.js",
"./sourceeditor/codemirror/lib/codemirror.js",
],
output: {
filename: "./sourceeditor/codemirror/codemirror.bundle.js",
libraryTarget: "var",
library: "CodeMirror",
},
+}, {
+ bail: true,
+
+ entry: [
+ // Inspector bundle
+ "./inspector/inspector.js",
+ // Landing page + local environment pre-bundled from a fork of debugger.html.
+ "./inspector/inspector-html-server/main.js"
+ ],
+ output: {
+ filename: "./inspector/inspector.bundle.js",
+ library: "InspectorBundle",
+ },
+ module: {
+ // Disable handling of unknown requires
+ unknownContextRegExp: /$^/,
+ unknownContextCritical: false,
+
+ // Disable handling of requires with a single expression
+ exprContextRegExp: /$^/,
+ exprContextCritical: false,
+
+ // Warn for every expression in require
+ wrappedContextCritical: true,
+
+ loaders: [
+ {
+ test: /event-emitter/,
+ exclude: /node_modules/,
+ loaders: [__dirname + "/webpack/rewrite-event-emitter"],
+ },
+ ]
+ },
+ resolveLoader: {
+ root: [
+ 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"),
+ "devtools/shared/platform": path.join(__dirname, "../shared/platform/content"),
+ 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: () => {} }",
+ "dump": "console.log",
+ }),
+ ],
+
+ externals: [
+ /codemirror\//,
+ {
+ "promise": "var Promise",
+ "devtools/server/main": "{}",
+
+ // Just trying to get build to work. These should be removed eventually:
+ "chrome": "{}",
+
+ // In case you end up in chrome-land you can use this to help track down issues.
+ // SDK for instance does a bunch of this so if you somehow end up importing an SDK
+ // dependency this might help for debugging:
+ // "chrome": `{
+ // Cc: {
+ // "@mozilla.org/uuid-generator;1": { getService: () => { return {} } },
+ // "@mozilla.org/observer-service;1": { getService: () => { return {} } },
+ // },
+ // Ci: {},
+ // Cr: {},
+ // Cm: {},
+ // components: { classesByID: () => {} , ID: () => {} }
+ // }`,
+
+ "resource://gre/modules/XPCOMUtils.jsm": "{}",
+ "resource://devtools/client/styleeditor/StyleEditorUI.jsm": "{}",
+ "resource://devtools/client/styleeditor/StyleEditorUtil.jsm": "{}",
+ "devtools/client/inspector/inspector-panel": "{}",
+ "devtools/server/actors/utils/audionodes.json": "{}",
+
+ "devtools/client/shared/developer-toolbar": "{}",
+
+ // From sdk.
+ "resource://gre/modules/Preferences.jsm": "{}",
+ "@loader/options": "{}",
+ "@loader/unload": "{}",
+ },
+ ],
}];