Skip to content

1.0.12版本对stc-inline的影响 #1

@xuexb

Description

@xuexb

发现升级后在使用 stc-inline 时配置文件不变, 编译后代码有问题, 配置如:

stc.workflow({
    uglify: {plugin: uglify, exclude: [/static\/admin\/src/]},
    cssCombine: {plugin: cssCombine, include: /\.css$/},
    cssCompress: {
        plugin: cssCompress
    },
    localstorage: {
        include: {
            type: 'tpl'
        },
        plugin: localstorage,
        options: {
            adapter: localstorageAdapter,
            minLength: 200,
            appId: '3e988cdb'
        }
    },
    htmlCompress: {
        plugin: htmlCompress,
        options: {
            trim: true
        }
    },
    resourceVersion: {
        plugin: resourceVersion
    },
    inline: {
        plugin: inline,
        include: /\.html$/,
        options: {
            uglify: true,
            datauri: true,
            jsinline: true,
            allowRemote: true
        }
    },
})
  • 在 stc-plugin@1.0.11 的时候这样写是可以正常被 stc-inline 编译的
  • 在 stc-plugin@1.0.12 时有问题, 生成的是:
<link rel=stylesheet href="/static/mip/css/all.css?v=6e813" inline>

必须把配置里的 inline 移动 resourceVersion 前面才行, 不知道是不是 bug...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions