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

Some parts of template literals are copied with minify() #7770

Closed
kdy1 opened this issue Aug 7, 2023 · 1 comment · Fixed by #7773
Closed

Some parts of template literals are copied with minify() #7770

kdy1 opened this issue Aug 7, 2023 · 1 comment · Fixed by #7773
Assignees
Labels
Milestone

Comments

@kdy1
Copy link
Member

kdy1 commented Aug 7, 2023

Describe the bug

I think this is related to cm: Lrc<SourceMap> in the ES codegen

Input code

(self["webpackChunkabc_orchestra"] = self["webpackChunkabc_orchestra"] || []).push([[118],{

    /***/ "./node_modules/path/to/abc.js":
    /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
    
    "use strict";
    
    Object.defineProperty(exports, "__esModule", ({ value: true }));
    exports.MainCSS = exports.sHeight = void 0;
    exports.sHeight = "asdasd";
    const sWidth = "asdasd";
    const sAsideWidth = "weqweqw";
    const sHeight = "asdsads";
    function absolute(abeetew = {}) {
        return `
        abc: cde;
        def: ${abeetew.def || 0};
        qwert: ${abeetew.qwert || 0};
        asda: ${abeetew.asda || 0};
        left: ${abeetew.abc || 0};
    `;
    }
    function flex() {
        return `
        abc: ab;
        cdef: de;
        ghn: fg;
        sadasn: hi;
    `;
    }
    exports.MainCSS = `
    .ThisshouldOnlyBeonTop {
        ${absolute()}
        asda-asdasda: asdad-asdsa;
    }
    .abcBlablaOneQSR {
        line-height: ${exports.sHeight};
        text-shadow: none;
    }
    .abcBlablaOne .asdsad {
        ${flex()}
        ${absolute()}
        
        asdasd-adsdas: asdasd-asdas;
        xzczxc: zxczxcc;
    }
    .asdasd {
        ${absolute({ abc: sAsideWidth + "!important", def: exports.sHeight + "!important", qwert: "0 !important" })}
        sdsd: auto !important;
        xcxcx: auto !important;
    }
    .aasdasdasd .asdsada {
        we: ${sWidth} !important;
    }
    .asdasdasd:not(.adsadsad) .asdasdasd {
        ds: ${parseFloat(exports.sHeight) + parseFloat(sHeight)}rem !important;
    }
    `;
    //# sourceMappingURL=abc.js.map
    
    /***/ })
    
    
    }]);

Config

No response

Playground link

No response

Expected behavior

It should not be copied

Actual behavior

No response

Version

1.3.74

Additional context

No response

@swc-bot
Copy link
Collaborator

swc-bot commented Sep 17, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

2 participants