Juanoterocas
10/03/2019, 7:50 PManton.bannykh
10/04/2019, 4:43 PMJuanoterocas
10/04/2019, 6:05 PMJuanoterocas
10/04/2019, 6:09 PManton.bannykh
10/05/2019, 3:27 PManton.bannykh
10/07/2019, 9:52 AMIlya Goncharov [JB]
10/07/2019, 10:07 AMJuanoterocas
10/08/2019, 3:04 PMIlya Goncharov [JB]
10/08/2019, 3:31 PMwebpack.resolve.modules
(https://webpack.js.org/configuration/resolve/#resolvemodules), if you want
You can affect weback’s configuration via plain js in webpack.config.d
folderJuanoterocas
10/08/2019, 3:43 PMJuanoterocas
10/08/2019, 6:46 PMsnrostov
10/08/2019, 6:52 PMOld frontend plugin resolve this automatically by npm install on module build directory, should be "like" the same way on new JS(frontend) approachOld frontend plugin will install copy of all transitive dependencies at each module build directory. To avoid duplicated common npm modules, we should have some common
node_module
where all such common modules are installed.snrostov
10/08/2019, 6:53 PMis there any documentation on how to write js files to webpack -kotlin? conversion guide?It is not ready, sorry
snrostov
10/08/2019, 6:56 PMsnrostov
10/08/2019, 7:03 PMJuanoterocas
10/08/2019, 7:23 PMBtw, why do you need to override outputFile property?
You can get rid of that line and the output will be parentName-module-Name.js , I Just want to have module name.
kotlin/BrowserTest-FrontBrowser.jssnrostov
10/08/2019, 7:51 PMJuanoterocas
10/08/2019, 8:03 PMsnrostov
10/08/2019, 8:05 PMoutputFile
. It should work without thatJuanoterocas
10/08/2019, 8:44 PMERROR in ./kotlin/BrowserTest-FrontBrowser.js
Module not found: Error: Can't resolve 'react-chartjs-2' in '/home/devquilla/Downloads/kotlin/BrowserTest/build/js/packages/BrowserTest-FrontBrowser/kotlin'
@ ./kotlin/BrowserTest-FrontBrowser.js 1027:148-174
@ multi ./kotlin/BrowserTest-FrontBrowser.js source-map-support/browser-source-map-support.js
snrostov
10/08/2019, 9:34 PMsnrostov
10/08/2019, 9:35 PMJuanoterocas
10/08/2019, 9:35 PMJuanoterocas
10/08/2019, 10:28 PMsnrostov
10/09/2019, 2:59 PM-t
mode). Also source maps should work out of the box.
tl;dr
issues in your project
- your https://github.com/steelxtreme/KotlinBrowserTest/blob/d48b93900951a1a3af0a6b2aa1f1032aebbaee5e/FrontBrowser/webpack.config.d/devServer.js will overwrite config.devServer object, not extending it. So, all properties like config.devServer.contentBase are lost. To extend object you may write something like this: config.devServer.historyApiFallback = true
- you are setting proxy = mapOf("/" to "<http://0.0.0.0:8080>"),
which causes that all urls will be proxied to http://0.0.0.0:8080. including index.html and js bundle.
- for some reason bundle name is FrontBrowser-unspecified.js
in run mode, not BrowserTest-FrontBrowser.js
and it looks like an issue in our plugin. @Ilya Goncharov [JB] please take a look.
- There is no reason to set dev server contentBase. It is by default on resources folder.
- There is no reason to configure source maps. It should work out of the box.
With all that fixes it is work for me: https://github.com/steelxtreme/KotlinBrowserTest/pull/1Juanoterocas
10/09/2019, 3:02 PM