Preliminary Learning of React - Building a Personal Blog with React
I wrote a very simple personal blog with React and Webpack, mainly to get familiar with the use of various basic properties and methods in react. I encountered a lot of problems during the construction process. By reading the official API , I have a better understanding of the life cycle and status improvement of react.
- build tool webpack
- css compilation using css-loader
Blog source code [email protected] :sunrun93/react-blog-app.git
- Download the source code locally, install dependencies through npm i, and run the project with npm start
After the dependencies are installed, you must find the css-loader configuration in the node_modules\react-scripts\config\webpack.config.dev.js and node_modules\react-scripts\config\webpack.config.prod.js files, and check the options Make corresponding modifications, add the following two lines, and enable css-modules.
{ loader: require.resolve('css-loader'), options: { ...... modules: true, localIdentName: '[name]__[local]__[hash:base64:5]' }, },