tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

webpack.config.js (784B)


      1 const path = require("path");
      2 const webpack = require("webpack");
      3 
      4 const config = {
      5  devtool: "sourcemap",
      6 };
      7 
      8 if (webpack.version && webpack.version[0] === "4") {
      9  // Webpack 3, used in sourcemaps-reload-uncompressed, doesn't support mode attribute.
     10  // Webpack 4, used in sourcemaps-reload-compressed we want production mode in order to compress the sources
     11  config.mode = "production";
     12 } else {
     13  // Also Webpack 4 doesn't support the module.loaders attribute
     14  config.module = {
     15    loaders: [
     16      {
     17        test: /\.js$/,
     18        exclude: /node_modules/,
     19        loader: "babel-loader",
     20      },
     21    ],
     22  };
     23 }
     24 
     25 module.exports = Object.assign({}, config, {
     26  entry: [path.join(__dirname, "original.js")],
     27  output: {
     28    path: __dirname,
     29    filename: "bundle.js",
     30  },
     31 });