1

我在故事书中创建一个简单的反应工具箱按钮故事时遇到问题。我想强调一点,我在应用程序中设置的所有 react-toolbox 都运行良好。适当postcss.config.js的文件如下所示:

const theme = require('./src/theme');

module.exports = {
  plugins: {
    'postcss-import': {
      root: __dirname
    },
   'postcss-mixins': {},
   'postcss-each': {},
   'postcss-cssnext': {
      browsers: ['last 2 versions', '> 5%'],
      features: {
        customProperties: {
          variables: theme
        }
      }
    }
  }
};

我收到了这个错误,我不确定我的配置中缺少哪个加载程序。

ERROR in ./~/react-toolbox/lib/button/theme.css
Module parse failed: /Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/react-toolbox/lib/button/theme.css Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp.unexpected (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1597:21)
    at Parser.pp$3.parseExpression (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1573:21)
    at Parser.pp$1.parseStatement (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:727:47)
 @ ./~/react-toolbox/lib/button/index.js 24:13-35
ERROR in ./~/react-toolbox/lib/ripple/theme.css
Module parse failed: /Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/react-toolbox/lib/ripple/theme.css Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp.unexpected (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1597:21)
    at Parser.pp$3.parseExpression (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:1573:21)
    at Parser.pp$1.parseStatement (/Users/kuko/Workspace/in2core/qtakecloud-frontend/node_modules/@kadira/storybook/node_modules/acorn/dist/acorn.js:727:47)
 @ ./~/react-toolbox/lib/ripple/index.js 13:13-35

看起来有问题,@import但为什么我的应用程序一切正常?有人在这里,可以帮助我解决这个问题吗?

感谢您的任何建议。

4

0 回答 0