summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/webpack.config.js')
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/webpack.config.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/webpack.config.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/webpack.config.js
new file mode 100644
index 0000000000..88afb5b73e
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/webpack.config.js
@@ -0,0 +1,54 @@
+const path = require("path");
+const webpack = require("webpack");
+
+const config = {
+ devtool: "sourcemap",
+};
+
+if (webpack.version && webpack.version[0] === "4") {
+ // Webpack 3, used in sourcemaps-reload-uncompressed, doesn't support mode attribute.
+ // Webpack 4, used in sourcemaps-reload-compressed we want production mode in order to compress the sources
+ config.mode = "production";
+} else {
+ // Also Webpack 4 doesn't support the module.loaders attribute
+ config.module = {
+ loaders: [
+ {
+ test: /\.js$/,
+ exclude: /node_modules/,
+ loader: "babel-loader",
+ },
+ ],
+ };
+}
+
+const originalBundle = Object.assign({}, config, {
+ entry: [path.join(__dirname, "original.js")],
+ output: {
+ path: __dirname,
+ filename: "bundle.js",
+ },
+});
+
+const bundleWithAnotherOriginalFile = Object.assign({}, config, {
+ entry: [
+ // This should cause the content of `original-with-no-update.js`
+ // to shift in the new `bundle-with-another-original.js` generated.
+ path.join(__dirname, "another-original.js"),
+ path.join(__dirname, "original-with-no-update.js")
+ ],
+ output: {
+ path: __dirname,
+ filename: "bundle-with-another-original.js"
+ }
+});
+
+const replacedBundle = Object.assign({}, config, {
+ entry: [path.join(__dirname, "new-original.js")],
+ output: {
+ path: __dirname,
+ filename: "replaced-bundle.js",
+ },
+});
+
+module.exports = [originalBundle, bundleWithAnotherOriginalFile, replacedBundle];