marko-webpack
marko-webpack copied to clipboard
Changing the entrypoint in Webpack configuration
Hi there, I'm trying to set the entry value in the webpack config like this:
... compiler({ name: 'Client', entry: './shared/api/user.js', optimization: { splitChunks: { ...
After doing this, I'm getting strange errors:
WARNING in ./node_modules/fastify/lib/server.js
Module not found: Error: Can't resolve 'http2' in 'C:\Users\mma2\Documents\JS\ft\node_modules\fastify\lib'
@ ./node_modules/fastify/lib/server.js
@ ./node_modules/fastify/fastify.js
@ ./shared/api/user.js
WARNING in ./node_modules/fast-json-stringify/index.js
Module not found: Error: Can't resolve 'long' in 'C:\Users\mma2\Documents\JS\ft\node_modules\fast-json-stringify'
@ ./node_modules/fast-json-stringify/index.js
@ ./node_modules/fastify/lib/reply.js
@ ./node_modules/fastify/fastify.js
@ ./shared/api/user.js
WARNING in ./node_modules/fast-json-stringify/index.js
Module not found: Error: Can't resolve 'uglify-es' in 'C:\Users\mma2\Documents\JS\ft\node_modules\fast-json-stringify'
@ ./node_modules/fast-json-stringify/index.js
@ ./node_modules/fastify/lib/reply.js
@ ./node_modules/fastify/fastify.js
@ ./shared/api/user.js
WARNING in ./node_modules/fast-json-stringify/index.js
Module not found: Error: Can't resolve 'uglify-es/package.json' in 'C:\Users\mma2\Documents\JS\ft\node_modules\fast-json-stringify'
@ ./node_modules/fast-json-stringify/index.js
@ ./node_modules/fastify/lib/reply.js
@ ./node_modules/fastify/fastify.js
@ ./shared/api/user.js
ERROR in ./node_modules/fastify-plugin/index.js
Module not found: Error: Can't resolve 'console' in 'C:\Users\mma2\Documents\JS\ft\node_modules\fastify-plugin'
@ ./node_modules/fastify-plugin/index.js 4:16-34
@ ./node_modules/fastify-cors/index.js
@ ./shared/api/user.js
ERROR in ./node_modules/busboy/lib/main.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\mma2\Documents\JS\ft\node_modules\busboy\lib'
@ ./node_modules/busboy/lib/main.js 1:9-22
@ ./node_modules/fastify-multipart/index.js
@ ./shared/api/user.js
After commenting the "entry" variable in config it's falling back to default value ('./src') and everything works fine. But even if I set the entry like this:
entry: './src/index.js',
It fails with the same error. Looks like something goes wrong with marko browser plugin.