Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/scss #28

Merged
merged 27 commits into from
Dec 11, 2019
Merged

Feature/scss #28

merged 27 commits into from
Dec 11, 2019

Conversation

jpuncle
Copy link
Collaborator

@jpuncle jpuncle commented Dec 11, 2019

使用 webpack 处理 scss + css

  1. 支持直接将 css 当作 entry 来处理,为了避免和 js 的 entry 冲突,建议不要使用和同目录下 js 文件相同的文件名
  2. js entry 里 import 的 css 也会被打包成同名的 css 文件
  3. Css 和图片均按照 src 下原目录输出到 build 目录
  4. 支持 @import "~xxxxx"加载 node_modules 中内容

关于图片

  1. 去掉了图片压缩功能
  2. 可以通过 ?datauri 参数明确指定转化为 data-uri
  3. 小于 1kb 的图片,自动转换为 data-uri
  4. 保留了 svg 压缩功能
  5. js 中 import svg 时,可以通过 ?inline 参数获取 svg 内容
  6. node_modules 的图片,保持目录结构,输出到 build 目录下

其他

  1. 使用 .browserslistrc 和 postcss.config.js 来配置 autoprofixer
  2. 使用 postcss.config.js 还可以增加其他功能
  3. 复制 public 目录到 build 目录
  4. 修复 nunjuck includePretty 对齐问题
  5. 打开浏览器时,使用 external 地址打开
  6. css 和 js 的 import 增加 @/xxx 的方式来查找模块

zhangxingkai added 27 commits November 22, 2019 09:43
1. 添加 autoprefixer 支持
2. 添加 assets 支持
3. 处理 sass 缺失的背景图相对路径处理
4. 更新示例代码
@jpuncle jpuncle merged commit 6054c56 into master Dec 11, 2019
@jpuncle jpuncle deleted the feature/scss branch December 11, 2019 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant