Skip to content

Unable to import 3rd party CSS files #1220

@hanxue

Description

@hanxue

Using this template, I have a .vue file that imports the .css in the <script> section.

<template>
  <div id="app">
  <!-- more content here -->
  </div>
</template>

<script>
import Vue from 'vue'
import VueMaterial from 'vue-material'
import 'vue-material/dist/vue-material.min.css'
import './assets/material-icons.css'

Vue.use(VueMaterial)
// More javascript code here
</script>
<style lang="scss" scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>

The files node_modules/vue-material/dist/vue-material.min.css and ./assets/material-icons.css exists.

But when I run npm run dev, I do not see the CSS files loaded

image

I have another project that uses similar syntax, and the CSS works fine. This is the webpack.conf.js for that project https://gist.github.com/hanxue/4fe712752319178668eadb326e468322

What changes do I need to make so that the CSS files get loaded?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions