小编dev*_*ive的帖子

模块解析失败:意外字符“?” (1:0) 您可能需要适当的加载程序来处理此文件类型

我在 React 应用程序中使用 styleguidist,这是我的 styleguid.config.js 文件的代码:

\n\n
module.exports = {\n  webpackConfig: {\n    module: {\n      rules: [\n        // Babel loader, will use your project\xe2\x80\x99s .babelrc\n        {\n          test: /\\.jsx?$/,\n          exclude: /node_modules/,\n          loader: \'babel-loader\'\n        },\n        // Other loaders that are needed for your components\n        {\n          test: /\\.css$/,\n          loader: \'style-loader!css-loader?modules\'\n        }\n      ]\n    }\n  }\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

现在我想在运行于http://localhost:6060 的styleguidist 服务器中显示条形码图像。\n我的 styleguidist readme.md 的代码

\n\n
```jsx\nvar Macybarcode = require(\'../../../containers/assets/img/macy/barcode.png\');\nconst barcode_img = Macybarcode;\nconst barcode_no = "33527111690008";\n\n<BarcodeMacy1 imgString={barcode_img} lineString={barcode_no} paddingTop="20px" width="50%" height="40px" />   \n```\n
Run Code Online (Sandbox Code Playgroud)\n\n

但每当我尝试显示图像时,我的服务器都会出现以下错误:

\n\n …

reactjs react-styleguidist

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

react-styleguidist ×1

reactjs ×1