如何在Meteor.js中的React组件中导入CSS

时间:2019-02-13 08:53:54

标签: javascript reactjs meteor react-dates

我正在尝试在react组件中导入“反应日期”。

import 'react-dates/initialize';
import 'react-dates/lib/css/_datepicker.css';
import { DateRangePicker, SingleDatePicker, DayPickerRangeController } from 'react-dates';

但是每次遇到此错误

 /home/suvo/projects/startup/selsy-dashboard/node_modules/react-dates/lib/css/_datepicker.css:1
 (function (exports, require, module, __filename, __dirname) { .PresetDateRangePicker_panel {
                                                               ^

 SyntaxError: Unexpected token .
     at createScript (vm.js:80:10)
     at Object.runInThisContext (vm.js:139:10)
     at Module._compile (module.js:616:28)
     at Object.Module._extensions..js (module.js:663:10)
     at Module.load (module.js:565:32)
     at tryModuleLoad (module.js:505:12)
     at Function.Module._load (module.js:497:3)
     at Module.require (module.js:596:17)
     at require (internal/module.js:11:18)
     at npmRequire (/home/suvo/projects/startup/selsy-dashboard/.meteor/local/build/programs/server/npm-require.js:133:10)
     at Module.useNode (packages/modules-runtime.js:664:18)
     at _datepicker.css (packages/modules.js:1180:8)
     at fileEvaluate (packages/modules-runtime.js:336:7)
     at Module.require (packages/modules-runtime.js:238:14)
     at Module.moduleLink [as link] (/home/suvo/.meteor/packages/modules/.0.13.0.1j7g4w0.0i8m++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38)
     at index.js (ui/pages/Vendors/index.js:1:635)
     at fileEvaluate (packages/modules-runtime.js:336:7)
     at Module.require (packages/modules-runtime.js:238:14)
     at Module.moduleLink [as link] (/home/suvo/.meteor/packages/modules/.0.13.0.1j7g4w0.0i8m++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38)
     at index.js (ui/layouts/App/index.js:1:1365)
     at fileEvaluate (packages/modules-runtime.js:336:7)
     at Module.require (packages/modules-runtime.js:238:14)

我正在使用Meteor.js和cleverbeagle小狗入门项目。 https://github.com/cleverbeagle/pup

如果您需要其他任何信息,请告诉我。

0 个答案:

没有答案