mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 09:27:19 +08:00
16 lines
514 B
JavaScript
16 lines
514 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.webWorkerPlugin = void 0;
|
|
exports.webWorkerPlugin = ({ app }) => {
|
|
app.use((ctx, next) => {
|
|
if (ctx.query.worker != null) {
|
|
ctx.type = 'js';
|
|
ctx.body = `export default function WrappedWorker() {
|
|
return new Worker(${JSON.stringify(ctx.path)}, { type: 'module' })
|
|
}`;
|
|
return;
|
|
}
|
|
return next();
|
|
});
|
|
};
|
|
//# sourceMappingURL=serverPluginWebWorker.js.map
|