webpack-contrib / postcss-loader

PostCSS loader for webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parse ESM with javascript

luojunbang opened this issue · comments

Bug report

parse ESM with Javascript

Actual Behavior

using .mts , it can interopDefault, but using .mjs ,it can not be export default

the config can not be function

./utils.js
function loadConfig(){
/** ... */
try {
        importESM = new Function("id", "return import(id);"); // it should parse default?
      } catch (e) {
        importESM = null;
      }

Expected Behavior

How Do We Reproduce?

Please paste the results of npx webpack info here, and mention other relevant information

Sorry I don't undestand you, feel free to rewrite the problem and I will reopen