Bắt đầu dự án xây dựng WordpresJs (ok)
Ví dụ 1: Tạo theme và id root
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\package.json
{
"name": "twentyseventeen",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"babel-loader": "^8.1.0",
"css-loader": "^4.3.0",
"file-loader": "^6.1.0",
"html-webpack-plugin": "^4.5.0",
"mini-css-extract-plugin": "^0.11.3",
"postcss": "^8.1.1",
"postcss-loader": "^4.0.3",
"sass": "^1.26.11",
"sass-loader": "^10.0.2",
"style-loader": "^1.2.1",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
}
}
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\webpack.config.js
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\src\image.scss
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\src\index.html
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\src\index.js
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\src\App.js
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen.babelrc
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\functions.php
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\index.php
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\style.css

Ví dụ 2: Tạo Component Header
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\src\App.js
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\src\Header.js
C:\xampp\htdocs\celestial\wp-content\themes\twentyseventeen\functions.php
Last updated
Was this helpful?