凉亭组件的最佳做法

TheWebGuy

因此,我才刚刚开始使用gulp,bower和Polymer等工具编写前端代码。

我通过凉亭安装了聚合物和一些材料设计组件。

是参考bower_component文件夹中文件的最佳实践,例如:

<link rel="import" href="bower_components/paper-button/paper-button.html">

还是应该使用gulp将需要的内容复制到另一个文件夹结构中。

谢谢!

母亲

wiredep很可能是您要寻找的软件包。

它将搜索bower_components文件夹并将所有依赖项文件注入到index.html中

在HTML中的用法:

<html>
<head>
  <!-- bower:css -->
  <!-- endbower -->
</head>
<body>
  <!-- bower:js -->
  <!-- endbower -->
</body>

而在gulp中,您只需要:

gulp.src('index.html')
  .pipe(wiredep({
    optional: 'configuration',
    goes: 'here'
  }))
  .pipe(gulp.dest('./dest'));

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章