错误:
./node_modules/quill-emoji/dist/quill-emoji.css
ModuleParseError: Module parse failed: Unexpected character '�' (1:0)
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)在_app.js中,我有:
import "quill-emoji/dist/quill-emoji.css";在next.config.js中
const withCSS = require('@zeit/next-css');
const withImages = require("next-images");
const withPlugins = require("next-compose-plugins");
if (typeof require !== 'undefined') {
require.extensions['.less'] = () => {};
require.extensions['.css'] = file => {};
}
module.exports = withPlugins([
withImages,
withCSS
], {
devIndicators: {
autoPrerender: false,
},
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
...
})发布于 2020-07-25 04:54:36
emoji css似乎包含了data:image的内容,并加载了svg的内联。
我尝试了多个加载器,但找不到正确的顺序,你可能需要某个特定顺序的resolve-url-loader。
最好是使用next/head将其链接起来,然后结束它。
发布于 2020-07-25 04:23:20
我觉得表情符号是svg。您可能需要一个svg加载器来解决这个问题。
next-images增加了对jpg、jpeg、svg、png、ico、webp和gif图像的支持。
注意:我没有用quill测试过这一点。
这是一个示例代码片段。
const withImages = require("next-images");
module.exports = withImages({
webpack(config, options) {
return config;
}
});https://stackoverflow.com/questions/63080696
复制相似问题