After successfully configuring webpack-dev-server and Laravel Valet to serve the site and redirect to the correct path on mobile devices within the same network, I encountered an issue. The CSS was not being injected via JS served from memory; it only worked if I manually wrote the JS/CSS to disk, which is not ideal. I suspect that the JS on the mobile device is not pointing through the proxy, but I am unable to determine how to address this.
Any assistance would be greatly appreciated. Thank you!
entry: {
'app.bundle': './src/scripts/index.js',
},
cache: true,
output: {
filename: '[name].js',
publicPath: 'http://localhost:8080/',
chunkFilename: '[chunkhash].js',
},
.
.
.
devServer: {
hot: true,
inline: true,
overlay: false,
quiet: true,
host: '0.0.0.0',
proxy: {
'*': {
target: 'http://laravelapp.dev/',
changeOrigin: true,
},
},
disableHostCheck: true,
contentBase: path.resolve(__dirname, './src/templates'),
headers: {
'Access-Control-Allow-Origin': '*',
},
watchContentBase: true,
watchOptions: {
poll: false, // might be needed for homestead/vagrant setup, review
},
historyApiFallback: false,
noInfo: true,
},