热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

vuecli3sass配置全局变量报错

vue.config.js: styles和src同级12345678910111213css: {    loaderOptions: {      postcss: {        plugin

vue.config.js: styles和src同级



1
2
3
4
5
6
7
8
9
10
11
12
13
css: {

    loaderOptions: {

      postcss: {

        plugins: [

          // px2rem配置

          postcss,

        ]

      },

      sass: {

        data: `@import "./styles/variables.scss"`,

      }

    }

  },

报错信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
INFO  Starting development server...

 98% after emitting CopyPlugin                                                  



 ERROR  Failed to compile with 3 errors                                                                                                                                                 13:49:12



 error  in ./src/App.vue?vue&type=style&index=0&lang=scss&



Module build failed (from ./node_modules/sass-loader/lib/loader.js):