vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.83k stars 6.96k forks source link

[Bug Report] Tree shaking warnings when building #9916

Closed JohnMica closed 4 years ago

JohnMica commented 4 years ago

Environment

Vuetify Version: 2.1.13 Vue Version: 2.6.10 Browsers: Chrome 78.0.3904.108 OS: Mac OS 10.14.5

Steps to reproduce

Using nuxt/vuetify with vuetify 2.1.13

nuxt.config has

head: {},

  http2: {
    push: false,
    pushAssets: (req, res, publicPath, preloadFiles) =>
      preloadFiles
        .filter(f => f.asType === 'script' && f.file === 'runtime.js')
        .map(f => `<${publicPath}${f.file}>; rel=preload; as=${f.asType}`)
  },

...
modules: ['@nuxtjs/axios', '@nuxtjs/vuetify'],
buildModules: [],
  vuetify: {
    defaultAssets: {
      font: {
        family: 'Roboto'
      },
      icons: 'md'
    },
    icons: {
      iconfont: 'md'
    },
    customVariables: ['@/assets/scss/variables.scss'],
    treeShake: process.NODE_ENV !== 'production' ? false : true
  },
 build: {
    analyze: process.NODE_ENV !== 'production',
...
    transpile: [/^vuetify/],
    extractCSS: true,
    sourceMap: process.NODE_ENV === 'production' ? false : true,
   cssSourceMap: process.NODE_ENV === 'production' ? false : true,
  ...
      nodeEnv: 'production',
      removeAvailableModules: true,
      mergeDuplicateChunks: true,
      chunkIds: 'named',
      splitChunks: {
        cacheGroups: {
          styles: {
            name: 'styles',
            test: /\.(css|vue)$/,
            chunks: 'all',
            enforce: true
          }
        }
      }
    },
  ...
...
  }

Expected Behavior

expected no warnings on build for tree shake

Actual Behavior

warnings such as

WARNING in chunk 11 [extract-css-chunks-webpack-plugin]
Conflicting order between:
 * css ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-1-3!./node_modules/vuetify/src/components/VSlider/VSlider.sass
 * css ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-1-3!./node_modules/vuetify/src/components/VItemGroup/VItemGroup.sass

Reproduction Link

https://codepen.io

Other comments

not sure what is going on here but perhaps a bug in vuetify tree shake functionality or perhaps in my code ?

no reproduction link as the project is not public yet

KaelWD commented 4 years ago

Duplicate of #5271