Skip to content

css file import dose not work when build production files #4832

Closed
@BboyAwey

Description

Version

3.12.1

Reproduction link

https://github.com/BboyAwey/vue-cli-css-file-lose-while-building-production-files

Environment info

System:
    OS: macOS 10.15
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 8.12.0 - /usr/local/bin/node
    Yarn: 1.9.4 - /usr/local/bin/yarn
    npm: 5.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 78.0.3904.97
    Firefox: 70.0.1
    Safari: 13.0.2
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  3.12.1
    @vue/babel-preset-jsx:  1.1.2
    @vue/babel-sugar-functional-vue:  1.1.2
    @vue/babel-sugar-inject-h:  1.1.2
    @vue/babel-sugar-v-model:  1.1.2
    @vue/babel-sugar-v-on:  1.1.2
    @vue/cli-overlay:  3.12.1
    @vue/cli-plugin-babel: ^3.12.0 => 3.12.1
    @vue/cli-plugin-eslint: ^3.12.0 => 3.12.1
    @vue/cli-plugin-unit-jest: ^3.12.0 => 3.12.1
    @vue/cli-service: ^3.12.0 => 3.12.1
    @vue/cli-shared-utils:  3.12.1
    @vue/component-compiler-utils:  3.0.2
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0
    @vue/preload-webpack-plugin:  1.1.1
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.3 (4.7.1)
    jest-serializer-vue:  2.0.2
    vue: ^2.6.10 => 2.6.10
    vue-eslint-parser:  5.0.0 (2.0.3)
    vue-hot-reload-api:  2.3.4
    vue-jest:  3.0.5
    vue-loader:  15.7.2
    vue-router: ^3.0.3 => 3.1.3
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
    vuex: ^3.0.1 => 3.1.2
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

1.run yarn to install all deps
2.run yarn serve to start dev server
I imported a css file from admin-ui/dist/style.css in main.js, and It works fine. Then we build:
3.run yarn build to build production files
and check the dist dir, the code from that css file is missing!!
Then I create another directory in node_modules and put a css file in it and import it in main.js, then build again, it works fine!!
Magic!!!

What is expected?

The code from css file admin-ui/dist/style.css should work and show themselves in production files.

What is actually happening?

The code from css file admin-ui/dist/style.css works fine when in dev mode but disappear in production files


What a magic moment!!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions