{"size": 2774, "ext": "js", "max_stars_repo_path": "vue.config.js", "max_stars_repo_name": "DorianGrey/vue-ts-playground", "max_stars_repo_stars_event_min_datetime": "2017-06-19T08:17:30.000Z", "max_stars_repo_stars_event_max_datetime": "2017-06-19T08:17:30.000Z", "max_issues_repo_path": "vue.config.js", "max_issues_repo_name": "DorianGrey/vue-ts-playground", "max_issues_repo_issues_event_min_datetime": "2018-01-20T11:54:54.000Z", "max_issues_repo_issues_event_max_datetime": "2018-05-07T09:30:11.000Z", "max_forks_repo_path": "vue.config.js", "max_forks_repo_name": "DorianGrey/vue-ts-playground", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 31.8850574713, "max_line_length": 101, "alphanum_fraction": 0.5454217736}
const PurgeCssPlugin = require("purgecss-webpack-plugin");
const glob           = require("globby");
const paths          = require("./config/paths");

module.exports = {
  outputDir: paths.appBuild,
  lintOnSave: false,
  pwa: {
    manifestPath: "manifest.webmanifest",
    name: "Demo App",
    themeColor: "#303030",
    mobileWebAppCapable: "yes",
    appleMobileWebAppCapable: "no",
    appleMobileWebAppStatusBarStyle: "black-translucent",
    workboxOptions: {
      // We're forcing this - otherwise, request the user to reload the page
      // would not behave as intended.
      skipWaiting: true,
      clientsClaim: true
    }
  },
  chainWebpack: config => {
    config
      .plugin("html")
      .tap(args => {
        args.forEach(arg => {
          arg.loadingCss = require("./scripts/renderLoading")().css;
        });
        return args;
      });

    config
      .when(process.env.NODE_ENV === "production", config => {
        // Use a runtime chunk to optimize cache busting.
        // Otherwise, the runtime information would be added to the entry point.
        config
          .optimization
          .runtimeChunk({ name: "runtime" });

          // Configure path alias for rxjs.
          const rxPaths = require("rxjs/_esm2015/path-mapping");
          const rxResolvedPaths = rxPaths();
          for (const p in rxResolvedPaths) {
            if (rxResolvedPaths.hasOwnProperty(p)) {
              config.resolve.alias.set(p, rxResolvedPaths[p]);
            }
          }

        // Configure style purging.
        const purgeOptions = {
          paths: glob.sync([
            paths.resolveApp("public/index.html"),
            paths.resolveApp("src/**/*.vue"),
            paths.resolveApp("node_modules/vuetify/es5/**/*.js")
          ]),
          styleExtensions: [".sass", ".scss", ".css", ".styl"],
          whitelist: [
            "*:not*", // See issue: https://github.com/purifycss/purifycss/issues/161
            ".notices", // Hierarchy not detected correctly.
            ".snackbar", // Same
            ".carousel-3d-container"
          ],
          whitelistPatterns: [
            /v-input__(append|prepend)-outer/,
            /picker(-reverse)?-transition/,
            /tab(-reverse)?-transition/,
            /--text$/
          ]
        };
        config
          .plugin("purgecss")
          .use(PurgeCssPlugin, [purgeOptions]) // Mind the array!
        ;

        // Configure workbox to exclude manifest.webmanifest (only excludes manifest.json by default)
        config
          .plugin("workbox")
          .tap(args => {
            args.forEach(arg => {
              arg.exclude.push(/manifest\.webmanifest$/);
            });
            return args;
          })
        ;
      });
  }
};