How does webpack introduce non-modular files?

the code with this plug-in goes like this

var aaa;
aaa.prototype.b = ****

I tried exports-loader. I can"t do it. Could you tell me how to do it?

plugin address: https://github.com/davidshimj.

Mar.01,2021

first of all, you have to make it clear that what you need is the aaa constructor, right? There is a problem with the definition of the problem. exports-loader is mainly about this,

//aaa
const aaa = require("exports-loader?aaa!./aaa.js");
console.log(aaa)

solved

npm i -D exports-loader

a.vue, single file uses

let QRCode = require('exports-loader?QRCode!qrcodejs/qrcode')
mounted () {
    console.log(new QRCode(...))
}

.eslintrc.js needs to close a validation

'import/no-webpack-loader-syntax': 'off'
Menu