Skip to content

Instantly share code, notes, and snippets.

@jeremymeng
Last active April 21, 2023 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremymeng/e843ced0671ac1c23fe9b7c8e7f40632 to your computer and use it in GitHub Desktop.
Save jeremymeng/e843ced0671ac1c23fe9b7c8e7f40632 to your computer and use it in GitHub Desktop.
@azure/storage-blob Web Worker Webpack 5
{
"name": "webpack-demo",
"version": "1.0.0",
"description": "",
"private": "true",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"html-webpack-plugin": "^5.5.1",
"local-web-server": "^5.3.0",
"webpack": "^5.80.0",
"webpack-cli": "^5.0.2"
},
"dependencies": {
"@azure/storage-blob": "^12.14.0",
"jsdom": "^21.1.1",
"node-polyfill-webpack-plugin": "^2.0.1"
}
}
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
module.exports = {
mode: 'development',
entry: {
index: './src/index.js',
worker: './src/worker.js',
polyfill: './src/polyfill.worker.js',
},
plugins: [
new HtmlWebpackPlugin({
title: 'Storage Web Worker Sample',
}),
new NodePolyfillPlugin({
includeAliases: [
"path", "stream", "process", "Buffer"
]
})
],
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
resolve: {
extensions: [".js"],
fallback: {
child_process: false,
crypto: false,
http: false,
https: false,
os: false,
zlib: false,
perf_hooks: false,
fs: false,
net: false,
tls: false,
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment