Advertisement
Guest User

Untitled

a guest
Mar 9th, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const path = require('path');
  2. const ROOT = path.resolve(__dirname, '..');
  3. const ip = require('ip').address();
  4. console.log(ip)
  5. const config = {
  6.   root: ROOT,
  7.   // webpack-dev-server
  8.   pluginConfigPath: 'plugins/plugins.json',
  9.   pluginFilePath: 'plugins/plugins.js',
  10.   // router
  11.   routerFilePath: 'router/index.js',
  12.   // common
  13.   templateDir: '.temp',
  14.   entryFilePath: 'entry.js',
  15.   dev: {
  16.     // Various Dev Server settings
  17.     contentBase: ROOT,
  18.     host: ip,
  19.     port: 8081,
  20.     historyApiFallback: true,
  21.     open: false,
  22.     watchContentBase: true,
  23.     openPage: '',
  24.     watchOptions: {
  25.       ignored: /node_modules/,
  26.       aggregateTimeout: 300,
  27.       poll: false
  28.     },
  29.         /**
  30.      * Source Maps
  31.      */
  32.     // https://webpack.js.org/configuration/devtool/#development
  33.     devtool: 'eval-source-map',
  34.     env: JSON.stringify('development'),
  35.     // If you have problems debugging vue-files in devtools,
  36.     // set this to false - it *may* help
  37.     // https://vue-loader.vuejs.org/en/options.html#cachebusting
  38.     cacheBusting: true,
  39.     // CSS Sourcemaps off by default because relative paths are "buggy"
  40.     // with this option, according to the CSS-Loader README
  41.     // (https://github.com/webpack/css-loader#sourcemaps)
  42.     // In our experience, they generally work as expected,
  43.     // just be aware of this issue when enabling this option.
  44.     cssSourceMap: false,
  45.     proxyTable: {},
  46.     autoOpenBrowser: false,
  47.     errorOverlay: true,
  48.     notifyOnErrors: true,
  49.     htmlOptions: {
  50.       devScripts: `
  51.         <script>
  52.           window.addEventListener('load', function () {
  53.             var is_touch_device = function () {
  54.               return 'ontouchstart' in window // works on most browsers
  55.                   || 'onmsgesturechange' in window; // works on ie10
  56.             };
  57.             if(!is_touch_device()) {
  58.               if (window.parent === window) { // not in iframe.
  59.                 window.phantomLimb.stop()
  60.               }
  61.             }
  62.           })
  63.         </script>
  64.         `
  65.     }
  66.   },
  67.   prod: {
  68.     env: JSON.stringify('production'),
  69.     /**
  70.      * Source Maps
  71.      */
  72.     productionSourceMap: true,
  73.     // https://webpack.js.org/configuration/devtool/#production
  74.     devtool: '#source-map',
  75.     cssSourceMap: true,
  76.     productionSourceMap: true
  77.   },
  78.   nodeConfiguration: {
  79.     global: false,
  80.     Buffer: false,
  81.     __filename: false,
  82.     __dirname: false,
  83.     setImmediate: false,
  84.     clearImmediate: false,
  85.     // see: https://github.com/webpack/node-libs-browser
  86.     assert: false,
  87.     buffer: false,
  88.     child_process: false,
  89.     cluster: false,
  90.     console: false,
  91.     constants: false,
  92.     crypto: false,
  93.     dgram: false,
  94.     dns: false,
  95.     domain: false,
  96.     events: false,
  97.     fs: false,
  98.     http: false,
  99.     https: false,
  100.     module: false,
  101.     net: false,
  102.     os: false,
  103.     path: false,
  104.     process: false,
  105.     punycode: false,
  106.     querystring: false,
  107.     readline: false,
  108.     repl: false,
  109.     stream: false,
  110.     string_decoder: false,
  111.     sys: false,
  112.     timers: false,
  113.     tls: false,
  114.     tty: false,
  115.     url: false,
  116.     util: false,
  117.     vm: false,
  118.     zlib: false
  119.   }
  120. }
  121. module.exports = config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement