早上看了个题目,不懂为什么会这样
//a.js
let counter = 10;
export default counter;
// index.js
import counter from "./a";
counter ++//这个是可以打印出11
counter+=1//error,counter is not defined
console.log(counter);
(下午17:00)补充下环境,用webpack起的dev-server服务:
webpack 4.41.2
nodejs v14.7.0
webpack-dev-server 3.9.0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…