Advertisement
Guest User

Untitled

a guest
Aug 7th, 2019
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var path = require("path");
  2. var webpack = require("webpack");
  3. const bundleOutputDir = "./wwwroot/dist";
  4. require("babel-polyfill");
  5. const VuetifyLoaderPlugin = require("vuetify-loader/lib/plugin");
  6.  
  7. module.exports = {
  8.   mode: "production",
  9.   context: __dirname,
  10.   plugins: [new VuetifyLoaderPlugin()],
  11.   entry: { main: "./FrontEnd/index.js" },
  12.   module: {
  13.     rules: [
  14.       {
  15.         test: /\.s(c|a)ss$/,
  16.         use: [
  17.           "vue-style-loader",
  18.           "css-loader",
  19.           {
  20.             loader: "sass-loader",
  21.             options: {
  22.               implementation: require("sass"),
  23.               fiber: require("fibers")
  24.             }
  25.           }
  26.         ]
  27.       },
  28.       {
  29.         test: /\.vue$/,
  30.         loader: "vue-loader",
  31.         options: {
  32.           loaders: {
  33.             scss: ["vue-style-loader", "css-loader"]
  34.           }
  35.         }
  36.       },
  37.       {
  38.         test: /\.js$/,
  39.         loader: "babel-loader",
  40.         exclude: /node_modules/
  41.       },
  42.       {
  43.         test: /\.(png|jpg|gif|svg)$/,
  44.         loader: "file-loader",
  45.         options: {
  46.           name: "[name].[ext]?[hash]"
  47.         }
  48.       }
  49.     ]
  50.   },
  51.   resolve: {
  52.     alias: {
  53.       vue$: "vue/dist/vue.esm.js"
  54.     },
  55.     extensions: ["*", ".js", ".vue", ".json"]
  56.   },
  57.   devServer: {
  58.     historyApiFallback: true,
  59.     noInfo: true,
  60.     overlay: true
  61.   },
  62.   performance: {
  63.     hints: false
  64.   },
  65.   output: {
  66.     path: path.join(__dirname, bundleOutputDir),
  67.     filename: "[name].js",
  68.     publicPath: "dist/"
  69.   },
  70.   devtool: "#eval-source-map"
  71. };
  72.  
  73. if (process.env.NODE_ENV === "production") {
  74.   module.exports.devtool = "#source-map";
  75.   module.exports.plugins = (module.exports.plugins || []).concat([
  76.     new webpack.DefinePlugin({
  77.       "process.env": {
  78.         // eslint-disable-next-line quotes
  79.         NODE_ENV: '"production"'
  80.       }
  81.     }),
  82.     new webpack.optimize.UglifyJsPlugin({
  83.       sourceMap: true,
  84.       compress: {
  85.         warnings: false
  86.       }
  87.     }),
  88.     new webpack.LoaderOptionsPlugin({
  89.       minimize: true
  90.     }),
  91.     new webpack.optimize.ModuleConcatenationPlugin()
  92.   ]);
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement