Comments (4)
先将sass-loader中的sassOptions中的outputStyle配置修改下吧,目前默认配置的是compressed,这个配置会将scss中的注释给清楚掉,可以先修改为 expanded,我们后续在脚手架中也进行下修改
from mpx.
先将sass-loader中的sassOptions中的outputStyle配置修改下吧,目前默认配置的是compressed,这个配置会将scss中的注释给清楚掉,可以先修改为 expanded,我们后续在脚手架中也进行下修改
我试了一下还是不行,编译出来是这样的:
.title{color:blue;color:red;font-size:18px}
我的loader是这么配置的:
// mpx的loader配置在这里传入
// 配置项文档:https://www.mpxjs.cn/api/compile.html#mpxwebpackplugin-loader
module.exports = {
// 自定义 loaders
loaders: {
// [2022-06-15] 增加 scss 支持
scss: [
{
loader: 'sass-loader',
options: {
sassOptions: { outputStyle: 'expanded' }
}
},
{ loader: 'css-loader' }
]
}
}
from mpx.
可以上传下你的复现demo哈
from mpx.
先将sass-loader中的sassOptions中的outputStyle配置修改下吧,目前默认配置的是compressed,这个配置会将scss中的注释给清楚掉,可以先修改为 expanded,我们后续在脚手架中也进行下修改
我试了一下还是不行,编译出来是这样的:
.title{color:blue;color:red;font-size:18px}我的loader是这么配置的:
// mpx的loader配置在这里传入 // 配置项文档:https://www.mpxjs.cn/api/compile.html#mpxwebpackplugin-loader module.exports = { // 自定义 loaders loaders: { // [2022-06-15] 增加 scss 支持 scss: [ { loader: 'sass-loader', options: { sassOptions: { outputStyle: 'expanded' } } }, { loader: 'css-loader' } ] } }
目前新版mpx不需要在loader options中配置rules了,目前这个配置已经废弃了,可以直接去webpack config的module.rules中进行配置
from mpx.
Related Issues (20)
- [Bug report] serve web ts报错 HOT 1
- [Bug report] 2.9.x版本 eslint 报错导致 serve 跑不起来 HOT 1
- [Bug report] `onLoad`, `onShow` and so on hooks not found in node_modules/@mpxjs/core/src/index.js HOT 3
- [Bug report] 最新的core类型声明为什么删除了对PropType类型的支持? HOT 1
- [Bug report]optimizeRenderRules 优化导致的bug HOT 2
- [Bug report] 使用setData更新数据时,某些场景会报错:TypeError: Cannot read property 'length' of null HOT 1
- web平台 onReachBottom 事件报错 HOT 1
- [Bug report]微信小程序不支持component动态引入组件 HOT 2
- 转 web 时 `scss` 通过 additionalData 引入的全局变量 px 不会被转化为 vw 或 rem HOT 1
- wx 转 web 时 externalClasses 不生效 HOT 3
- [Bug report] 每次打包都提示 Error: EBUSY: resource busy or locked, rmdir 'dist/wx' HOT 6
- [Bug report] 转 web时通过 js 引用图片时生成的 原子类代码会有乱码 HOT 1
- [Bug report] Skyline 模式下 worklet 函数写在 composition api 的 setup 中不被触发,写在 methods 中可以触发 HOT 4
- [Feature Request] 希望增加开关控制是否将 unocss 写的临时 px 值在编译结果里转换为 rpx HOT 8
- [Bug report]编译为支付宝小程序不会处理custom-tab-bar目录 HOT 1
- 微信 转 web 时使用 `relations` 建立组件关系,使用`getRelationNodes`获取关联组件报错 HOT 1
- [Bug report] 首次运行pnpm run serve出错 HOT 1
- [Bug report]初始化 npm run serve失败,用了楼上的方法仍然失败 HOT 2
- [Bug report]重新安装脚手架后无法create项目
- [Bug report] `mpx.xfetch`的TS类型报错 HOT 1
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 mpx.