When I import(ES6) or require(CommonJS) a package installed by npm, is it possbile to specify the slim version ?
For example I npm install socket.io-client
, socket.io-client
provides socket.io.slim.js & socket.io.dev.js
according to https://socket.io/docs/v2/client-installation/ I use ES6 import import io from 'socket.io-client'
in my code.
Is it possbile to use socket.io.dev.js
for development and socket.io.slim.js
for production ?
I use webpack
to bundle the code. I can't find the options to let webpack use socket.io.slim.js
instead of socket.io.js
. The build mode won't work because that will only use the "normal"production version socket.io.js
not the slim version.
BTW, I am not sure if .slim.js
is a standard name extension for javascript library, but it seems to be introduced by jQuery as a build without some extensions, as discusses here What is slim in file.slim.js. For socket.io.slim.js
is the " Production version, without debug"