Keyi 8 лет назад
Родитель
Сommit
5a86555954
4 измененных файлов с 1268 добавлено и 15 удалено
  1. 15 2
      package.json
  2. 3 1
      src/index.js
  3. 4 1
      webpack.config.js
  4. 1246 11
      yarn.lock

+ 15 - 2
package.json

@@ -9,11 +9,21 @@
       "react",
       "stage-2"
     ],
-    "plugins": ["react-hot-loader/babel"]
+    "plugins": [
+      "react-hot-loader/babel",
+      [
+        "import",
+        {
+          "libraryName": "antd",
+          "style": "css"
+        }
+      ]
+    ]
   },
   "devDependencies": {
     "babel-core": "^6.25.0",
     "babel-loader": "^7.1.0",
+    "babel-plugin-import": "^1.2.1",
     "babel-preset-es2015": "^6.24.1",
     "babel-preset-react": "^6.24.1",
     "babel-preset-stage-2": "^6.24.1",
@@ -24,8 +34,11 @@
     "start": "webpack-dev-server --progress --colors --hot --config ./webpack.config.js"
   },
   "dependencies": {
+    "antd": "^2.12.1",
+    "css-loader": "^0.28.4",
     "react": "^15.6.1",
     "react-dom": "^15.6.1",
-    "react-hot-loader": "next"
+    "react-hot-loader": "next",
+    "style-loader": "^0.18.2"
   }
 }

+ 3 - 1
src/index.js

@@ -1,10 +1,12 @@
 import React from 'react';
 import ReactDOM from 'react-dom';
 
+import { DatePicker } from 'antd';
+
 const title = <h2>Test setup</h2>;
 
 ReactDOM.render(
-  <div>{title}</div>,
+  <DatePicker />,
   document.getElementById('app')
 );
 

+ 4 - 1
webpack.config.js

@@ -10,7 +10,10 @@ module.exports = {
       test: /\.jsx?$/,
       exclude: /node_modules/,
       loaders: ['react-hot-loader/webpack','babel-loader'],
-    }]
+    },
+    {
+      test: /\.css$/, loader: "style-loader!css-loader" 
+  }]
   },
   resolve: {
     extensions: ['*', '.js', '.jsx']

Разница между файлами не показана из-за своего большого размера
+ 1246 - 11
yarn.lock