Guest User

Untitled

a guest
May 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. import Calendar from 'react-calendar';
  2.  
  3. import Calendar from 'react-calendar';
  4. ...
  5. var _MonthView2 = _interopRequireDefault(_MonthView);
  6.  
  7. require('./Calendar.css');
  8.  
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. ...
  11.  
  12. C:NODEpath_to_app_dirnode_modulesreact-calendardistCalendar.css:1
  13. (function (exports, require, module, __filename, __dirname) { .react-calendar {
  14. ^
  15. SyntaxError: Unexpected token .
  16. at createScript (vm.js:80:10)
  17. at Object.runInThisContext (vm.js:139:10)
  18. at Module._compile (module.js:616:28)
  19. at Object.Module._extensions..js (module.js:663:10)
  20. at Module.load (module.js:565:32)
  21. at tryModuleLoad (module.js:505:12)
  22. at Function.Module._load (module.js:497:3)
  23. at Module.require (module.js:596:17)
  24. at require (internal/module.js:11:18)
  25. at Object.<anonymous> (C:NODEpath_to_app_dirnode_modulesreact-calendardistentry.js:28:1)
  26. at Module._compile (module.js:652:30)
  27. at Object.Module._extensions..js (module.js:663:10)
  28. at Module.load (module.js:565:32)
  29. at tryModuleLoad (module.js:505:12)
  30. at Function.Module._load (module.js:497:3)
  31. at Module.require (module.js:596:17)
  32.  
  33. const webpack = require('webpack');
  34. const path = require('path');
  35. const nodeExternals = require('webpack-node-externals');
  36. const StartServerPlugin = require('start-server-webpack-plugin');
  37. const MiniCssExtractPlugin = require("mini-css-extract-plugin");
  38.  
  39. module.exports = {
  40. devtool: 'cheap-module-source-map',
  41. watch: true,
  42. mode: 'development',
  43. target: 'node',
  44. entry: [
  45. 'babel-polyfill',
  46. 'webpack/hot/poll?1000',
  47. path.resolve('./api/index'),
  48. ],
  49. output: {
  50. path: path.resolve('.build'),
  51. filename: 'server.js',
  52. },
  53. resolve: {
  54. modules: [
  55. path.resolve('.'), // to resolve path 'server/', 'config/'
  56. path.resolve('./client'), // to resolve path liek '/components' on client
  57. 'node_modules',
  58. ],
  59. },
  60. externals: [
  61. nodeExternals({
  62. whitelist: ['webpack/hot/poll?1000'],
  63. }),
  64. ],
  65. module: {
  66. rules: [
  67. {
  68. test: /.js?$/,
  69. use: 'babel-loader',
  70. exclude: /node_modules/,
  71. },
  72. {
  73. test: /.html$/,
  74. use: 'html-loader',
  75. },
  76. {
  77. test: /.(scss|css|sass)$/,
  78. include: [/node_modules/],
  79. use: [
  80. MiniCssExtractPlugin.loader,
  81. {
  82. loader: "css-loader",
  83. options: {
  84. modules: true,
  85. sourceMap: true,
  86. importLoader: 2
  87. }
  88. },
  89. "sass-loader"
  90. ]
  91. },
  92. {
  93. test: /.md$/,
  94. use: 'raw-loader',
  95. },
  96. {
  97. test: /.(png|jpg|jpeg|gif|woff|woff2|svg|eot|ttf|otf|wav|mp3)$/,
  98. use: [
  99. {
  100. loader: 'file-loader',
  101. options: {
  102. emitFile: false
  103. },
  104. },
  105. ],
  106. },
  107. ],
  108. },
  109. plugins: [
  110. new MiniCssExtractPlugin({
  111. filename: "css/styles.css",
  112. }),
  113. new StartServerPlugin('server.js'),
  114. new webpack.NamedModulesPlugin(),
  115. new webpack.HotModuleReplacementPlugin(),
  116. new webpack.NoEmitOnErrorsPlugin(),
  117. new webpack.DefinePlugin({
  118. 'process.env': {
  119. BUILD_TARGET: JSON.stringify('server'),
  120. NODE_ENV: JSON.stringify('development'),
  121. },
  122. }),
  123. ],
  124. stats: {
  125. modules: false,
  126. hash: false,
  127. version: false,
  128. colors: true,
  129. assets: false,
  130. },
  131. };
Add Comment
Please, Sign In to add comment