mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
This change is needed so the bundle can be used with: ``` <script type="module" src="xxxx/socket.io.js"></script> ``` Related: - https://github.com/socketio/socket.io/discussions/3828 -13b32b39a4-8c08c5d5c3
35 lines
776 B
JavaScript
35 lines
776 B
JavaScript
const { BannerPlugin } = require("webpack");
|
|
const version = require("../package.json").version;
|
|
|
|
const banner = `Socket.IO v${version}
|
|
(c) 2014-${new Date().getFullYear()} Guillermo Rauch
|
|
Released under the MIT License.`;
|
|
|
|
module.exports = {
|
|
entry: "./build/index.js",
|
|
output: {
|
|
filename: "socket.io.js",
|
|
library: "io",
|
|
libraryTarget: "umd",
|
|
globalObject: "self",
|
|
},
|
|
mode: "development",
|
|
devtool: "source-map",
|
|
node: false,
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.m?js$/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
options: {
|
|
presets: ["@babel/preset-env"],
|
|
plugins: ["@babel/plugin-transform-object-assign"],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
plugins: [new BannerPlugin(banner)],
|
|
};
|