Problems with webpack external extension externals references

introduce zepto.min.js in index.html

//webpack.config.js
externals: {
  "zepto": "Zepto"
}

//index.js
import $ from "zepto"

if you quote it like this, you will get an error, Cannot find module "zepto"
but

//webpack.config.js
externals: {
  zepto : {
      commonjs: "Zepto",
      amd: "Zepto",
      root: "$" // 
   }
}

//index.js
window.$

that"s fine, so did I write something wrong

Dec.28,2021

may be because zepto is a non-modular library, which can only be retrieved globally by root. It is possible to replace it with jQuery.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e483e1-44cb0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e483e1-44cb0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?