Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小浣熊撸代码
uni-app
提交
b86f990c
U
uni-app
项目概览
小浣熊撸代码
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b86f990c
编写于
11月 19, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mp-toutiao): rpx with !important #1014
上级
d2b27693
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
211 addition
and
0 deletion
+211
-0
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+8
-0
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/LICENSE-MIT
...gin-uni/packages/postcss-normalize-whitespace/LICENSE-MIT
+22
-0
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/README.md
...lugin-uni/packages/postcss-normalize-whitespace/README.md
+44
-0
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/dist/index.js
...n-uni/packages/postcss-normalize-whitespace/dist/index.js
+97
-0
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/package.json
...in-uni/packages/postcss-normalize-whitespace/package.json
+40
-0
未找到文件。
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
b86f990c
...
...
@@ -246,6 +246,14 @@ moduleAlias.addAlias('vue-template-compiler', '@dcloudio/vue-cli-plugin-uni/pack
moduleAlias
.
addAlias
(
'
@megalo/template-compiler
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/@megalo/template-compiler
'
)
moduleAlias
.
addAlias
(
'
mpvue-template-compiler
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/mpvue-template-compiler
'
)
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-toutiao
'
)
{
// !important 始终带有一个空格
moduleAlias
.
addAlias
(
'
postcss-normalize-whitespace
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/postcss-normalize-whitespace
'
)
}
if
(
runByHBuilderX
)
{
const
oldError
=
console
.
error
console
.
error
=
function
(
msg
)
{
...
...
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/LICENSE-MIT
0 → 100644
浏览文件 @
b86f990c
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/README.md
0 → 100644
浏览文件 @
b86f990c
# [postcss][postcss]-normalize-whitespace
> Normalize whitespace with PostCSS.
## Install
With
[
npm
](
https://npmjs.org/package/postcss-normalize-whitespace
)
do:
```
npm install postcss-normalize-whitespace --save
```
## Example
### Input
```
css
h1
{
width
:
calc
(
10px
-
(
100px
/
var
(
--test
)
))
}
```
### Output
```
css
h1
{
width
:
calc
(
10px
-
100px
/
var
(
--test
))
}
```
## Usage
See the
[
PostCSS documentation
](
https://github.com/postcss/postcss#usage
)
for
examples for your environment.
## Contributors
See
[
CONTRIBUTORS.md
](
https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md
)
.
## License
MIT ©
[
Ben Briggs
](
http://beneb.info
)
[
postcss
]:
https://github.com/postcss/postcss
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/dist/index.js
0 → 100644
浏览文件 @
b86f990c
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
_postcss
=
require
(
"
postcss
"
);
var
_postcssValueParser
=
require
(
"
postcss-value-parser
"
);
var
_postcssValueParser2
=
_interopRequireDefault
(
_postcssValueParser
);
function
_interopRequireDefault
(
obj
)
{
return
obj
&&
obj
.
__esModule
?
obj
:
{
default
:
obj
};
}
const
atrule
=
"
atrule
"
;
const
decl
=
"
decl
"
;
const
rule
=
"
rule
"
;
function
reduceCalcWhitespaces
(
node
)
{
if
(
node
.
type
===
"
space
"
)
{
node
.
value
=
"
"
;
}
else
if
(
node
.
type
===
"
function
"
)
{
node
.
before
=
node
.
after
=
""
;
}
}
function
reduceWhitespaces
(
node
)
{
if
(
node
.
type
===
"
space
"
)
{
node
.
value
=
"
"
;
}
else
if
(
node
.
type
===
"
div
"
)
{
node
.
before
=
node
.
after
=
""
;
}
else
if
(
node
.
type
===
"
function
"
)
{
node
.
before
=
node
.
after
=
""
;
if
(
node
.
value
.
toLowerCase
()
===
"
calc
"
)
{
_postcssValueParser2
.
default
.
walk
(
node
.
nodes
,
reduceCalcWhitespaces
);
return
false
;
}
}
}
exports
.
default
=
(
0
,
_postcss
.
plugin
)(
"
postcss-normalize-whitespace
"
,
()
=>
{
return
css
=>
{
const
cache
=
{};
css
.
walk
(
node
=>
{
const
{
type
}
=
node
;
if
(
~
[
decl
,
rule
,
atrule
].
indexOf
(
type
)
&&
node
.
raws
.
before
)
{
node
.
raws
.
before
=
node
.
raws
.
before
.
replace
(
/
\s
/g
,
""
);
}
if
(
type
===
decl
)
{
// Ensure that !important values do not have any excess whitespace
if
(
node
.
important
)
{
// fixed by xxxxxx 头条小程序 rpx!important 中间必须有空格,否则无法正确转换
node
.
raws
.
important
=
"
!important
"
;
}
// Remove whitespaces around ie 9 hack
node
.
value
=
node
.
value
.
replace
(
/
\s
*
(\\
9
)\s
*/
,
"
$1
"
);
const
value
=
node
.
value
;
if
(
cache
[
value
])
{
node
.
value
=
cache
[
value
];
}
else
{
const
parsed
=
(
0
,
_postcssValueParser2
.
default
)(
node
.
value
);
const
result
=
parsed
.
walk
(
reduceWhitespaces
).
toString
();
// Trim whitespace inside functions & dividers
node
.
value
=
result
;
cache
[
value
]
=
result
;
}
// Remove extra semicolons and whitespace before the declaration
if
(
node
.
raws
.
before
)
{
const
prev
=
node
.
prev
();
if
(
prev
&&
prev
.
type
!==
rule
)
{
node
.
raws
.
before
=
node
.
raws
.
before
.
replace
(
/;/g
,
""
);
}
}
node
.
raws
.
between
=
"
:
"
;
node
.
raws
.
semicolon
=
false
;
}
else
if
(
type
===
rule
||
type
===
atrule
)
{
node
.
raws
.
between
=
node
.
raws
.
after
=
""
;
node
.
raws
.
semicolon
=
false
;
}
});
// Remove final newline
css
.
raws
.
after
=
""
;
};
});
module
.
exports
=
exports
[
"
default
"
];
\ No newline at end of file
packages/vue-cli-plugin-uni/packages/postcss-normalize-whitespace/package.json
0 → 100644
浏览文件 @
b86f990c
{
"name"
:
"postcss-normalize-whitespace"
,
"version"
:
"4.0.2"
,
"description"
:
"Trim whitespace inside and around CSS rules & declarations."
,
"main"
:
"dist/index.js"
,
"files"
:
[
"dist"
,
"LICENSE-MIT"
],
"scripts"
:
{
"prepublish"
:
"cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
},
"keywords"
:
[
"css"
,
"postcss"
,
"postcss-plugin"
],
"license"
:
"MIT"
,
"devDependencies"
:
{
"babel-cli"
:
"^6.0.0"
,
"cross-env"
:
"^5.0.0"
},
"homepage"
:
"https://github.com/cssnano/cssnano"
,
"author"
:
{
"name"
:
"Ben Briggs"
,
"email"
:
"beneb.info@gmail.com"
,
"url"
:
"http://beneb.info"
},
"repository"
:
"cssnano/cssnano"
,
"dependencies"
:
{
"postcss"
:
"^7.0.0"
,
"postcss-value-parser"
:
"^3.0.0"
},
"bugs"
:
{
"url"
:
"https://github.com/cssnano/cssnano/issues"
},
"engines"
:
{
"node"
:
">=6.9.0"
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录