Comments (6)
我接着尝试,发现scss放在utils里面被编译成了wxss,
from miniprogram-template.
图标是使用image
还是嵌入的背景图?
如果直接使用图片的话建个image的文件夹即可
assets
文件夹(可以配置)默认是放一些开发的时候用到,编译之后就没有的文件
比如公共的scss
或者内联的背景图文件。
需要注意一下引用文件路径
from miniprogram-template.
编译报错可以贴一下代码和错误信息
from miniprogram-template.
我导入的文件是这个sass-rpx
因为用的webstorm而且scss一直都报rpx的错
然后报错如下
[23:43:31] 4wxss > app.scss → app.wxss
[23:43:31] 5json > app.jsonc → app.json
[23:43:31] 4wxss [×] Error
src\app.scss
Error: Can't find stylesheet to import.
╷
1 │ @import "/assets/rpx";
│ ^^^^^^^^^^^^^
╵
src\app.scss 1:9 root stylesheet
src\app.scss
Error: src\app.scss
Error: Can't find stylesheet to import.
╷
1 │ @import "/assets/rpx";
│ ^^^^^^^^^^^^^
╵
src\app.scss 1:9 root stylesheet
at Object._newRenderError (Y:\clustered\node_modules\sass\sass.dart.js:10748:19)
at Object._wrapException (Y:\clustered\node_modules\sass\sass.dart.js:10598:16)
at _render_closure1.call$2 (Y:\clustered\node_modules\sass\sass.dart.js:33339:21)
at _RootZone.runBinary$3$3 (Y:\clustered\node_modules\sass\sass.dart.js:19690:18)
at _RootZone.runBinary$3 (Y:\clustered\node_modules\sass\sass.dart.js:19694:19)
at _FutureListener.handleError$1 (Y:\clustered\node_modules\sass\sass.dart.js:18159:19)
at _Future__propagateToListeners_handleError.call$0 (Y:\clustered\node_modules\sass\sass.dart.js:18447:40)
at Object._Future__propagateToListeners (Y:\clustered\node_modules\sass\sass.dart.js:3484:88)
at _Future._completeError$2 (Y:\clustered\node_modules\sass\sass.dart.js:18283:9)
at _AsyncAwaitCompleter.completeError$2 (Y:\clustered\node_modules\sass\sass.dart.js:17682:12)
Error in plugin "sass"
Message:
src\app.scss
Error: Can't find stylesheet to import.
╷
1 │ @import "/assets/rpx";
│ ^^^^^^^^^^^^^
╵
src\app.scss 1:9 root stylesheet
Details:
formatted: Error: Can't find stylesheet to import.
╷
1 │ @import "/assets/rpx";
│ ^^^^^^^^^^^^^
╵
src\app.scss 1:9 root stylesheet
line: 1
column: 9
file: Y:\clustered\src\app.scss
status: 1
messageFormatted: src\app.scss
Error: Can't find stylesheet to import.
╷
1 │ @import "/assets/rpx";
│ ^^^^^^^^^^^^^
╵
src\app.scss 1:9 root stylesheet
messageOriginal: Can't find stylesheet to import.
╷
1 │ @import "/assets/rpx";
│ ^^^^^^^^^^^^^
╵
src\app.scss 1:9 root stylesheet
relativePath: src\app.scss
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `mp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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\Blueness\AppData\Roaming\npm-cache\_logs\2019-09-21T15_43_31_279Z-debug.log
Process finished with exit code 1
这里是引用代码,我不调用这个,光引用就报错
@import "/assets/rpx";
text {
font-size: 30rpx;
color: #666;
}
page {
background-color: #f5f5f5;
min-height: 100%;
display: flex;
flex-direction: column;
}
@import "/assets/rpx";
text {
font-size: 30rpx;
color: #666;
}
page {
background-color: #f5f5f5;
min-height: 100%;
display: flex;
flex-direction: column;
}
我尝试把上面的_rpx.scss名字改为rpx.scss,也是不行的
from miniprogram-template.
scss 这个不支持绝对路径
@import "./assets/rpx";
// 或者
@import "rpx";
PS: 这个用VScode 装上插件 完全是另一种体验
如果需要支持 /
更目录引用 可以 在 https://github.com/NewFuture/miniprogram-build/issues 开一个讨论一下
from miniprogram-template.
好的谢谢,我试试vscode
from miniprogram-template.
Related Issues (20)
- [Feature Request] JSON Schema for sitemap HOT 2
- npm 国内镜像找不到 miniprogram-build 5.2.1 HOT 5
- How to track the update of this template? HOT 6
- tslib 打包上传后无法正确在真机上运行 HOT 10
- An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨 HOT 3
- An in-range update of @typescript-eslint/parser is breaking the build 🚨 HOT 3
- 关于globalData的问题 HOT 2
- 代码编译缺少wxss文件的问题 HOT 5
- wxml 属性变量自动换行问题 HOT 4
- 关于自定义dist目录的问题 HOT 1
- An in-range update of @typescript-eslint/parser is breaking the build 🚨 HOT 7
- An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨 HOT 7
- upload上传代码能否设置备注信息 HOT 1
- An in-range update of stylelint is breaking the build 🚨 HOT 3
- An in-range update of @typescript-eslint/parser is breaking the build 🚨 HOT 1
- An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨 HOT 1
- An in-range update of miniprogram-api-typings is breaking the build 🚨 HOT 1
- 是否可以在 SCSS 中 import 微信样式 WXSS 文件并获得正确的转换路径。 HOT 4
- Replace "miniprogram-api-typings" with "@types/wechat-miniprogram". HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miniprogram-template.