Problem with webpack and react
See original GitHub issueDescribe the bug
Impossible to load a unity canvas:
Desktop (please complete the following information):
- Browser [chrome, Firefox]
Additional context we used webpack cli: “webpack”: “^4.15.1”, “webpack-cli”: “^3.0.8”, “webpack-dev-server”: “^3.1.4”
in webpack we have:
new CopyWebpackPlugin([ {from:‘src/assets’,to:‘assets’}, {from:‘src/skins’,to:‘skins’}, {from:‘src/images’,to:‘images’}, {from:‘src/fonts’,to:‘fonts’}, {from:‘src/i18n’,to:‘i18n’}, {from:‘src/webGL’,to:‘webGL’} ])
in our structure we have:
scr/webGL
inside:
Build/
TemplatesData
index.html
and this init component:
this.unityContent = new UnityContent( "webGL/Build/webGl.json", "webGL/Build/UnityLoader.js" );
whats wrong!??! there is a webpack problem?
we don’t have a public folder…
output: { filename: 'main.js', path: path.resolve(__dirname, '..', 'dist'), publicPath: '/' // necessary for HMR to know where to load the hot update chunks },
please help…
thanks a lot
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
ooooooooooo fix it… was a error in webpack…
the problem was here:
devServer: { hot: true, // enable HMR on the server port: 3000, historyApiFallback: true, contentBase: path.resolve(__dirname, '..', 'src', 'scripts'), // match the output path publicPath: '/' // match the output
publicPath},
replace with:
devServer: { hot: true, // enable HMR on the server port: 3000, historyApiFallback: true, contentBase: path.resolve(__dirname, '..', 'src'), // match the output path publicPath: '/' // match the output
publicPath},
and i have removed:
new CopyWebpackPlugin([ {from:'src/assets',to:'assets'}, {from:'src/skins',to:'skins'}, {from:'src/images',to:'images'}, {from:'src/fonts',to:'fonts'}, {from:'src/i18n',to:'i18n'}, {from:'src/webGL',to:'webGL'} ])
thanks a lot for the supprt
Awesome! Have fun!