fix: testrunner rollup config

This commit is contained in:
Niklas von Hertzen 2021-07-11 19:20:19 +08:00
parent 99e55b5337
commit 6ab75dbb8b
2 changed files with 12 additions and 12 deletions

View File

@ -1,8 +1,8 @@
import nodeResolve from 'rollup-plugin-node-resolve'; import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs'; import commonjs from '@rollup/plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps'; import sourceMaps from 'rollup-plugin-sourcemaps';
import typescript from 'rollup-plugin-typescript2'; import typescript from '@rollup/plugin-typescript';
import json from 'rollup-plugin-json'; import json from '@rollup/plugin-json';
import {resolve} from 'path'; import {resolve} from 'path';
const pkg = require('../package.json'); const pkg = require('../package.json');
@ -36,14 +36,12 @@ export default {
// Allow json resolution // Allow json resolution
json(), json(),
// Compile TypeScript files // Compile TypeScript files
typescript({useTsconfigDeclarationDir: true, tsconfig: resolve(__dirname, 'tsconfig.json')}), typescript({
tsconfig: resolve(__dirname, 'tsconfig.json')
}),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs({ commonjs({
include: 'node_modules/**', include: 'node_modules/**'
namedModules: {
'node_modules/platform/platform.js': ['name', 'version'],
'node_modules/es6-promise/dist/es6-promise.js': ['Promise']
}
}), }),
// Resolve source maps to the original source // Resolve source maps to the original source

View File

@ -1,6 +1,8 @@
{ {
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"types": ["node", "mocha"] "types": ["node", "mocha"],
} "rootDir": "../"
},
"include": ["**/*.ts"]
} }