Guest User

Untitled

a guest
Feb 11th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const path = require("path"); // nodejs does not understand ES6 modules
  2. const glob = require("webpack-glob-entries");
  3. const JavaScriptObfuscator = require('webpack-obfuscator');
  4.  
  5. module.exports = {
  6.   // context: __dirname,
  7.  
  8.   entry: {
  9.     bundle: "./src/react/App.jsx",
  10.     aframeOthers: Object.values(glob("./src/aframe/**/*.js")),
  11.  
  12.     thirdparty: [
  13.       "./third-party/aframe-v.0.7.0.js",
  14.       "./third-party/aframe-utils.js",
  15.       "./third-party/aframe-animation-component.min.js",
  16.       "./third-party/aframe-extras-controls.min.js",
  17.       "./third-party/aframe-look-at-component.js",
  18.       "./third-party/aframe-touch-rotation-controls.smischanged.js",
  19.       "./third-party/sonic.js"
  20.     ]
  21.   },
  22.  
  23.   output: {
  24.     path: path.resolve("public"), // path.resolve turned 'public' in absolute path
  25.     filename: "[name].js"
  26.   },
  27.  
  28.   module: {
  29.     rules: [
  30.       {
  31.         enforce: "pre", // Preloader
  32.         test: /\.jsx?$/,
  33.         exclude: /node_modules/
  34.       },
  35.       {
  36.         test: /\.jsx?$/,
  37.         loader: "babel-loader"
  38.       }
  39.     ]
  40.   },
  41.  
  42.   plugins: [
  43.     new JavaScriptObfuscator ({
  44.         rotateUnicodeArray: false
  45.     })
  46.   ],
  47.  
  48.   resolve: {
  49.     extensions: [".jsx", ".js"]
  50.   },
  51.  
  52.   devServer: {
  53.     host: "0.0.0.0",
  54.     port: 8080,
  55.     hot: false,
  56.     inline: false,
  57.     historyApiFallback: {
  58.       index: "/public/"
  59.     }
  60.   }
  61. };
Add Comment
Please, Sign In to add comment