node-sass安装成功后 进行打包时出现错误呢

来源:4-5 Webpack配置(2)

聪聪不匆匆

2018-09-26

chencong@chencong-pc MINGW64 /f/admin-v2-fe (master)
$ node_modules/.bin/webpack
Hash: 0d8fcabffe2194d60a54
Version: webpack 3.10.0
Time: 1857ms
     Asset       Size  Chunks                    Chunk Names
    app.js     728 kB       0  [emitted]  [big]  main
 index.css   25 bytes       0  [emitted]         main
index.html  452 bytes          [emitted]
  [14] ./src/app.jsx 489 bytes {0} [built]
  [27] ./src/index.css 41 bytes {0} [built]
  [28] ./src/index.sass 178 bytes {0} [built] [failed] [1 error]
  [29] ./node_modules/css-loader!./src/index.css 188 bytes [built]
    + 29 hidden modules

ERROR in ./src/index.sass
Module parse failed: Unexpected token (1:4)
You may need an appropriate loader to handle this file type.
| body{
|     background: #ccc;
|     #app{
 @ ./src/app.jsx 13:0-23
Child html-webpack-plugin for "index.html":
     1 asset
       [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 743 bytes {0} [built]
       [2] (webpack)/buildin/global.js 509 bytes {0} [built]
       [3] (webpack)/buildin/module.js 517 bytes {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js!src/index.css:
       [0] ./node_modules/css-loader!./src/index.css 188 bytes {0} [built]
        + 1 hidden module

node-sass@4.7.2 已经安装成功,下面是再次执行安装命令时候显示的内容

$ yarn add node-sass@4.7.2 --dev
yarn add v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved 0 new dependencies.
Done in 5.05s.
写回答

1回答

Rosen

2018-09-27

提示有语法错误,可能是 loader 那配的有问题。仔细检查下,还不行把代码打包发我

0
0

React16+React-Router4 打造企业级电商后台管理系统

【毕设面试】让缺乏框架开发经验的你掌握框架开发

976 学习 · 405 问题

查看课程