0

i inject ${this.Classes} into my html tag in render function. when i start it with rollup, it works as expected. but when i try to build it with rollup build, it gives error: " html-minifier deleted something major, cannot proceed." and cant build.

 render() {
        let dis=this;
        return html`
            <link rel="stylesheet" href="../src/lib/jquery/dist/selectize/selectize.default.css" />

            dis.Style();

            <select id="select"></select>
        `;
    }

    Style() {
        let dis = this;
        return html`
            <style type="text/css">
                 .selectize-input {
                    padding: 0!important;
                    border: none;
                    border-radius: none;
                    background:white!important;
                    box-shadow:unset!important;
                    -webkit-box-shadow:unset!important;
                }

                ${dis.Klasslar}
            </style>
        `;
    }
Rajan Sharma
  • 2,211
  • 3
  • 21
  • 33
ali suleymanli
  • 1,033
  • 1
  • 9
  • 12
  • Are you interpolating correctly `dis.Style()`? (should be `${dis.Style()}`). Also, what is the content of `dis.Klasslar`? – Umbo Jul 23 '19 at 06:52
  • i mistyped dis.Style(). Yes it should be ${dis.Style()} . and content of dis.Klasslar is a string returns .clas{display:none} for example – ali suleymanli Jul 23 '19 at 14:13
  • slightly off-topic: you should ever need to do the `let dis = this;` assignment - these methods will be called with the correct `this`. – Justin Fagnani Jul 24 '19 at 02:36
  • Are you using this plugin? https://www.npmjs.com/package/rollup-plugin-minify-html-literals – Justin Fagnani Jul 24 '19 at 02:37

0 Answers0