Skip to content

The packaged CSS file does not contain non-routing components #4341

Closed
@SoldierAb

Description

@SoldierAb

Version

3.9.2

Environment info

//--- vue.config.js
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin')

module.exports = {

  publicPath: '/',

  configureWebpack: {
    module: {
      rules: [
        {
          test: /\.scss$/,
          use: ExtractTextPlugin.extract({
            fallback: "style-loader",
            use: [
              "css-loader",
              "sass-loader",
              {
                loader: 'sass-resources-loader',
                options: {
                  resources: path.resolve(__dirname, `./src/theme/${process.env.VUE_APP_THEME}.scss`)  //主题皮肤文件全局注入
                }
              }
            ]
          })
        },
      ]
    },
    plugins: [
      new ExtractTextPlugin({
        filename: `theme/${process.env.VUE_APP_THEME}.css`,
        allChunks: true      
      }),
    ],
   }
}



//App.vue  
<template>
  <div>
      <top-nav></top-nav>
      <router-view></router-view>
  </div>
</template>

<style lang="scss">

</style>


// ---------------------

Steps to reproduce

npm run build

What is expected?

The packaged CSS file contain non-routing components

What is actually happening?

The packaged CSS file does not contain non-routing components(App, TopNav)


Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproductionThis issue is missing a minimal runnable reproduction, provided by the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions