【问题标题】:Angular AoT Compilation with Sass styles and pug (jade) templates使用 Sass 样式和 pug (jade) 模板进行 Angular AoT 编译
【发布时间】:2017-03-08 20:07:12
【问题描述】:

有没有人找到在 webpack 中使用 Sass 和 pug 编译 Angular(版本 >= 2)的解决方案?

【问题讨论】:

  • 同样的问题,我有 aot + sass 工作,但我仍在将 pug 文件编译为 html(通过 pug cli)并使用 templateUrl 引用编译的 html。
  • 我知道解析 angular-cli(不适用于 WebPack)、AoT/JiT、单元和 E2E 测试 - 工作,适用于版本 2 及更高版本

标签: angular sass webpack pug angular2-aot


【解决方案1】:

将此添加到 config/webpack.common.js module.rules 中的 https://github.com/AngularClass/angular2-webpack-starter " { 测试:/.(pug|jade)$/, 使用:['pug-ng-html-loader'] } " 加上在resolve.extensions中我添加了“.pug” 这在 package.json devDependencies ' "哈巴狗": "^2.0.0-beta11", “pug-ng-html-loader”:“^1.0.10” ' 我可以使用“build:aot”和“server:dev:hmr”脚本运行 .pug 文件

【讨论】:

    猜你喜欢
    • 2018-02-14
    • 2017-04-19
    • 1970-01-01
    • 2017-11-10
    • 1970-01-01
    • 2014-04-09
    • 2016-09-04
    • 2018-12-13
    • 1970-01-01
    相关资源
    最近更新 更多