js Cannot assign to read only property 'exports' of object '#<Object>' at Modul,import 与module.exports混用问题

参考:https://blog.csdn.net/u014471623/article/details/77991363

 

原因是:The code above is ok. You can mix require and export. You can‘t mix import and module.exports.

翻译过来就是说,代码没毛病,在webpack打包的时候,可以在js文件中混用require和export。但是不能混用import 以及module.exports。

因为webpack 2中不允许混用importmodule.exports,

解决办法就是统一改成ES6的方式编写即可.

import {normalTime} from ‘./timeFormat‘;

export default normalTime;

 

其他情况:

文件名大小写问题

https://www.cnblogs.com/hao-1234-1234/p/11493295.html

posted @ 2020-10-26 09:30  Virya  阅读(834)  评论(0编辑  收藏  举报