Browse Source

feat: import react

yhhu 5 years ago
parent
commit
c64f9d92d0
3 changed files with 8 additions and 8 deletions
  1. 5 5
      src/index.js
  2. 1 1
      webpack/webpack.config.dev.js
  3. 2 2
      webpack/webpack.config.prod.js

+ 5 - 5
src/index.js

@@ -1,6 +1,6 @@
-const message = {
-  a: 1,
-  b: 2,
-}
 
-console.log(message)
+import React from 'react'
+
+const App = () => <div>App</div>
+
+export default App

+ 1 - 1
webpack/webpack.config.dev.js

@@ -59,7 +59,7 @@ module.exports = {
   ],
   devServer: {
     port: 8080,
-    contentBase: path.resolve(projectPath, 'build'),
+    contentBase: path.resolve(projectPath, 'dist'),
     hot: true,
   },
 }

+ 2 - 2
webpack/webpack.config.prod.js

@@ -25,7 +25,7 @@ module.exports = {
           {
             loader: MiniCssExtractPlugin.loader,
             options: {
-              publicPath: '../build/styles',
+              publicPath: '../dist/styles',
             },
           },
           {
@@ -46,7 +46,7 @@ module.exports = {
       chunkFilename: '[id].css',
     }),
     new HtmlWebpackPlugin({
-      title: 'CSS Modules Demo',
+      title: 'Datepicker',
       filename: 'index.html',
       template: path.resolve(projectPath, 'index.html'),
       inject: false,