Home

Issue: 1396

Can't resolve imported styles when using 1.0.0-rc4

[issue link]

I’m migrating nuxt from 0.10.7 to 1.0.0-rc4, and encounter two problems.

  1. Css modules which were installed via npm could not be parsed properly.

It complains,


This relative module was not found:

* ../../nust-boilerplate/themes/default/gitalk/dist/gitalk.css

In fact gitalk is located at ../../nust-boilerplate/themes/default/node_modules/gitalk/dist/gitalk.css

  1. Imported styles could not be parsed properly

With the code as below in one of my vue components,

<style lang="stylus" scoped>
@import 'assets/css/base/_base.styl';
.qrcode-pic
  width: 100%
</style>

It complains failed to locate @import file assets/css/base/_base.styl when building.

Here is my nuxt configs related to styles,

module.exports = {
  'css': [
    'highlight.js/styles/github.css',
    'gitalk/dist/gitalk.css',
    { 'src': 'assets/css/main.styl', 'lang': 'stylus' }
  ],
  ...
}
This question is available on Nuxt.js community (#c1238)