mirror of
https://github.com/logos-messaging/js-rln.git
synced 2026-01-05 23:23:12 +00:00
fix wasm karma server
This commit is contained in:
parent
b3d6ca001d
commit
26119afb81
@ -1,13 +1,35 @@
|
|||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const playwright = require('playwright');
|
const playwright = require('playwright');
|
||||||
|
const os = require("os");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
process.env.CHROME_BIN = playwright.chromium.executablePath();
|
process.env.CHROME_BIN = playwright.chromium.executablePath();
|
||||||
process.env.FIREFOX_BIN = playwright.firefox.executablePath();
|
process.env.FIREFOX_BIN = playwright.firefox.executablePath();
|
||||||
|
|
||||||
|
const output = {
|
||||||
|
path:
|
||||||
|
path.join(os.tmpdir(), "_karma_webpack_") +
|
||||||
|
Math.floor(Math.random() * 1000000),
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
config.set({
|
||||||
frameworks: ["webpack", "mocha"],
|
frameworks: ["webpack", "mocha"],
|
||||||
files: ["src/**/!(node).spec.ts"],
|
customHeaders: [{
|
||||||
|
match: '\\.wasm$',
|
||||||
|
name: 'Content-Type',
|
||||||
|
value: 'application/wasm'
|
||||||
|
}],
|
||||||
|
files: [
|
||||||
|
"src/**/!(node).spec.ts",
|
||||||
|
{
|
||||||
|
pattern: `${output.path}/**/*`,
|
||||||
|
watched: false,
|
||||||
|
included: false,
|
||||||
|
served: true,
|
||||||
|
},
|
||||||
|
{ pattern: 'bundle/**/*.wasm', included: false, served: true, type: 'wasm' }
|
||||||
|
],
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
"src/**/!(node).spec.ts": ["webpack"]
|
"src/**/!(node).spec.ts": ["webpack"]
|
||||||
},
|
},
|
||||||
@ -28,6 +50,7 @@ module.exports = function (config) {
|
|||||||
type: "asset/resource",
|
type: "asset/resource",
|
||||||
}, { test: /\.([cm]?ts|tsx)$/, loader: "ts-loader" }]
|
}, { test: /\.([cm]?ts|tsx)$/, loader: "ts-loader" }]
|
||||||
},
|
},
|
||||||
|
output,
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
"process.env.CI": process.env.CI || false,
|
"process.env.CI": process.env.CI || false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user