插件引入时保错
Module parse failed: Unexpected token (6675:253) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file)
download docx.js
解决了吗? 安装docx.js还是这个错
创建一个新项目引入可以,在旧的项目引入就报这个错
@PhoneixT 有解决吗?
config.module
.rule('docx')
.test(/node_modules\/@hufe921\/canvas-editor-plugin-docx\/dist\/docx.js/)
.use()
.loader('babel-loader')
.end()
指定加载器为babel-loader可以
指定加载器为babel-loader 会出现新的错误
config.module .rule('docx') .test(/node_modules[\/]@hufe921[\/]canvas-editor-plugin-docx[\/]dist[\/]docx.js/) .use() .loader('babel-loader') .end() windous系统用这个,windows系统和mac系统在路径引用方式上有区别
这个问题有解决方案吗,上面都试了 不行
download docx.js
下载之后也报了
插件里面已经下载了,你搞清楚自己项目用的加载器是babel-loader还是file-loader,然后用正确路径指定加载器就行
尝试各种 终于解决了,是win系统下路径不识别问题,
正确路径
好的 谢谢 关键问题是【正确路径】,不同系统识别路径有问题。已经解决了
@PhoneixT 有解决吗?
我在 vue.config.js 中 添加了 transpileDependencies: ['@hufe921/canvas-editor-plugin-docx'],