use rollup

This commit is contained in:
weboko 2023-02-02 00:21:38 +01:00
parent c2c866bc86
commit e7c1d3af35
No known key found for this signature in database
3 changed files with 26 additions and 30 deletions

View File

@ -10,9 +10,9 @@ const output = {
module.exports = function (config) {
config.set({
frameworks: ["webpack", "mocha"],
frameworks: ["rollup", "mocha"],
preprocessors: {
"**/*.ts": ["webpack"],
"**/*.ts": ["rollup"],
},
files: [
@ -34,33 +34,5 @@ module.exports = function (config) {
timeout: 6000, // Default is 2s
},
},
webpack: {
mode: "development",
devtool: 'source-map',
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: [".ts", ".tsx", ".js"],
plugins: [new ResolveTypeScriptPlugin()],
},
module: {
rules: [
{
test: /\.wasm$/,
type: "asset/resource",
},
{
test: /\.(js|tsx?)$/,
loader: "ts-loader",
exclude: /node_modules|\.d\.ts$/,
options: { configFile: "tsconfig.karma.json" },
},
{
test: /\.d\.ts$/,
loader: "ignore-loader",
},
],
},
output,
},
});
};

23
package-lock.json generated
View File

@ -60,6 +60,7 @@
"karma": "^6.3.12",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-rollup-preprocessor": "^7.0.8",
"karma-webpack": "^5.0.0",
"lint-staged": "^13.0.3",
"mocha": "^9.1.3",
@ -4061,6 +4062,12 @@
"node": ">=4.0"
}
},
"node_modules/debounce": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz",
"integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==",
"dev": true
},
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@ -7086,6 +7093,22 @@
"minimist": "^1.2.3"
}
},
"node_modules/karma-rollup-preprocessor": {
"version": "7.0.8",
"resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.8.tgz",
"integrity": "sha512-WiuBCS9qsatJuR17dghiTARBZ7LF+ml+eb7qJXhw7IbsdY0lTWELDRQC/93J9i6636CsAXVBL3VJF4WtaFLZzA==",
"dev": true,
"dependencies": {
"chokidar": "^3.3.1",
"debounce": "^1.2.0"
},
"engines": {
"node": ">= 8.0.0"
},
"peerDependencies": {
"rollup": ">= 1.0.0"
}
},
"node_modules/karma-webpack": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz",

View File

@ -79,6 +79,7 @@
"karma": "^6.3.12",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-rollup-preprocessor": "^7.0.8",
"karma-webpack": "^5.0.0",
"lint-staged": "^13.0.3",
"mocha": "^9.1.3",