Skip to content
Snippets Groups Projects
Select Git revision
  • develop default protected
  • 1356-update-packages
  • 1303-failing-to-refetch-federated-tracks
  • 1108-remove-jwt-and-switch-to-oauth-for-ui-auth
  • set-sast-config-2
  • set-sast-config-1
  • master
  • tracemallocmiddleware
  • 1299-encoding-problem-in-rss-feeds
  • 1346-selectoreventloop-required-instead-got-uvloop-loop
  • 1278-embed-isn-t-available-in-the-front-end-for-channel-tracks
  • 1311-feedparser-requires-update-to-accomodate-python-3-9
  • 1.0.1
  • 1121-download
  • plugins-v3
  • plugins-v2
  • plugins
  • 1.1.1
  • 1.1
  • 1.1-rc2
  • 1.1-rc1
  • 1.0.1
  • 1.0
  • 1.0-rc1
  • 0.21.2
  • 0.21.1
  • 0.21
  • 0.21-rc2
  • 0.21-rc1
  • 0.20.1
  • 0.20.0
  • 0.20.0-rc1
  • 0.19.1
  • 0.19.0
  • 0.19.0-rc2
  • 0.19.0-rc1
  • 0.18.3
37 results

vue.config.js

Blame
  • Forked from funkwhale / funkwhale
    4972 commits behind the upstream repository.
    vue.config.js 1.62 KiB
    
    const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
    const webpack = require('webpack');
    const PurgecssPlugin = require('purgecss-webpack-plugin')
    const glob = require('glob-all')
    const path = require('path')
    let plugins = [
      // do not include moment.js locales since it's quite heavy
      new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
    ]
    if (process.env.BUNDLE_ANALYZE === '1') {
      plugins.push(new BundleAnalyzerPlugin())
    }
    plugins.push(
      new PurgecssPlugin({
        paths: glob.sync([
          path.join(__dirname, './public/index.html'),
          path.join(__dirname, './public/embed.html'),
          path.join(__dirname, './**/*.vue'),
          path.join(__dirname, './src/**/*.js')
        ]),
        whitelist: ['scale'],
        whitelistPatterns:[/plyr/],
        whitelistPatternsChildren:[/plyr/,/dropdown/,/upward/]
      }),
    )
    module.exports = {
      baseUrl: process.env.BASE_URL || '/front/',
      productionSourceMap: false,
      pages: {
        embed: {
          entry: 'src/embed.js',
          template: 'public/embed.html',
          filename: 'embed.html',
        },
        index: {
          entry: 'src/main.js',
          template: 'public/index.html',
          filename: 'index.html'
        }
      },
      chainWebpack: config => {
        config.optimization.delete('splitChunks')
        config.plugins.delete('prefetch-embed')
        config.plugins.delete('prefetch-index')
      },
      configureWebpack: {
        plugins: plugins,
        devtool: false
      },
      devServer: {
        disableHostCheck: true,
        // use https://node1.funkwhale.test/front-server/ if you use docker with federation
        public: process.env.FRONT_DEVSERVER_URL || ('http://localhost:' + (process.env.VUE_PORT || '8080'))
      }
    }