我正在尝试使用 Wordpress 和 Roots Sage 开发一个 Wordpress 主题。在我的主题文件夹中,我安装了 sage
composer create-project roots/sage my-theme
输入所有配置后,我尝试启动yarn start
调用的开发构建webpack --hide-modules --watch --config resources/assets/build/webpack.config.js
。
Browsersync 然后给了我:
[BS] [HTML Injector] Running...
[Browsersync] Proxying: http://test.local
[Browsersync] Access URLs:
----------------------------------------
Local: http://localhost:3000
External: http://xxx:3000
----------------------------------------
UI: http://localhost:3001
UI External: http://xxx:3001
----------------------------------------
[Browsersync] Watching files...
浏览器选项卡打开,但没有任何形式的响应。该页面一直在加载。
Webpack 配置 ( resources/assets/build/webpack.config.js
) 是
{
"entry": {
"main": [
"./scripts/main.js",
"./styles/main.scss"
],
"customizer": [
"./scripts/customizer.js"
]
},
"publicPath": "/wp-content/themes/my-theme",
"devUrl": "http://test.local",
"proxyUrl": "http://localhost:3000",
"cacheBusting": "[name]_[hash:8]",
"watch": [
"app/**/*.php",
"config/**/*.php",
"resources/views/**/*.php"
]
}
有任何想法吗?谢谢!