Solo 项目打包 npm run build 出错

拉取最新版仓库代码,在进行皮肤升(qie)级(qu)开发时,使用
npm run build 报错!
45.jpg

具体:

$ npm run build;

> solo@4.0.0 build I:\idea_project\solo
> webpack --mode production

Browserslist: caniuse-lite is outdated. Please run next command `npm update`
   64 modules

ERROR in ./src/main/resources/skins/Bubble/css/base.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: File to import not found or unreadable: vditor/src/assets/scss/classic.
        on line 28 of I:\idea_project\solo\src\main\resources\skins\Bubble\css\base.scss
>> @import "vditor/src/assets/scss/classic";
   ^

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! solo@4.0.0 build: `webpack --mode production`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the solo@4.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lonus_lan\AppData\Roaming\npm-cache\_logs\2020-04-21T11_06_24_209Z-debug.log

大意是 File to import not found or unreadable: vditor/src/assets/scss/classic. 同样,ide 开发工具也提示找不到依赖,引入的依赖命令如下:

 @import "vditor/src/assets/scss/classic" 

引入此依赖的文件位置在 /resources/skins/Bubble/css/base.scss;

另:我在项目中也没有找到 vditor/src/assets/scss/classic 此路径及文件;

大佬有时间看看,小弟在此先行谢过!

2 回帖
请输入回帖内容...
  • Vanessa

    你是不是很久没有更新项目了,更新一下就好了。更新以后是这样的

    /*
     * skin style
     *
     * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
     * @version 0.4.1.1, Feb 9, 2020
     */
    @import "../../../scss/reset";
    @import "../../../scss/usite";
    @import "../../../scss/toc";
    @import "../../../scss/function";
    @import "vditor/src/assets/scss/index";
    
  • lonuslan 1 评论

    奇怪,为什么在 idea 中提示不能解析这个目录,但是我再重新打包又不报错了

    @import "vditor/src/assets/scss/index"
    

    他是怎么匹配路径的?我只发现在 node_modules 下面才有 vditor 这个包!

    这个是用 npm 安装的。打包脚本在 webpack 中
    Vanessa