Acidnuk
Acidnuk

Reputation: 73

Default vue-cli build do not create css file

When I build my project, I can not find any css file. Unlike the documentation says.

vue-cli-service build --target lib --name myLib ***

I have three files : umd, umd.min and common. And un message : "Images and other types of assets omitted".

Is there a special vuecli configuration to do?

I am experiencing this problem since I add unit tests in the project

Upvotes: 1

Views: 1448

Answers (1)

Marcos Leonel
Marcos Leonel

Reputation: 78

I had the same problem recently and the following solutions worked for me:

  1. Import the CSS file in the app entry, in my case, src/App.vue: import './assets/scss/main.scss';
  2. Change the build command in the package.json file to target the entry file that imports the style: vue-cli-service build --target lib --name index src/App.vue"
  3. Run npm run build or yarn run build.
  4. Voilà!

The CSS file will appear.

Upvotes: 1

Related Questions