Skip to content

Commit bc81edb

Browse files
committed
fix rollup version and config
1 parent cfea43c commit bc81edb

File tree

3 files changed

+88
-165
lines changed

3 files changed

+88
-165
lines changed

build/rollup.config.js

+2-20
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* eslint-disable @typescript-eslint/no-var-requires */
44
import path from 'path';
55

6-
import ts from 'rollup-plugin-typescript2';
6+
import ts from '@rollup/plugin-typescript';
77
import replace from '@rollup/plugin-replace';
88
import resolve from '@rollup/plugin-node-resolve';
99
import commonjs from '@rollup/plugin-commonjs';
@@ -31,9 +31,6 @@ const banner = `/*!
3131
* @license MIT
3232
*/`;
3333

34-
// ensure TS checks only once for each build
35-
let hasTSChecked = false;
36-
3734
const outputConfigs = {
3835
// each file name has the format: `dist/${name}.${format}.js`
3936
// format being a key of this object
@@ -95,25 +92,10 @@ function createConfig(format, output, plugins = []) {
9592

9693
if (isGlobalBuild) output.name = "VueDatatableUrlSync";
9794

98-
const shouldEmitDeclarations = !hasTSChecked;
9995

10096
const tsPlugin = ts({
101-
check: !hasTSChecked,
10297
tsconfig: path.resolve(__dirname, '../tsconfig.json'),
103-
cacheRoot: path.resolve(__dirname, '../node_modules/.rts2_cache'),
104-
tsconfigOverride: {
105-
compilerOptions: {
106-
sourceMap: output.sourcemap,
107-
declaration: shouldEmitDeclarations,
108-
declarationMap: shouldEmitDeclarations,
109-
},
110-
exclude: ['__tests__', 'test-dts'],
111-
},
11298
});
113-
// we only need to check TS and generate declarations once for each build.
114-
// it also seems to run into weird issues when checking multiple times
115-
// during a single build.
116-
hasTSChecked = true;
11799

118100
const external = ['vue-demi'];
119101

@@ -197,7 +179,7 @@ function createProductionConfig(format) {
197179
}
198180

199181
function createMinifiedConfig(format) {
200-
const { terser } = require('rollup-plugin-terser');
182+
const terser = require('@rollup/plugin-terser');
201183
return createConfig(
202184
format,
203185
{

package-lock.json

+84-143
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"@rollup/plugin-commonjs": "^17.1.0",
2929
"@rollup/plugin-node-resolve": "^11.2.0",
3030
"@rollup/plugin-replace": "^2.4.1",
31+
"@rollup/plugin-terser": "^0.4.0",
32+
"@rollup/plugin-typescript": "^11.0.0",
3133
"@types/jest": "^27.0.0",
3234
"@types/lodash.clonedeep": "^4.5.6",
3335
"@types/lodash.debounce": "^4.0.6",
@@ -48,8 +50,6 @@
4850
"eslint-plugin-typescript": "^0.14.0",
4951
"eslint-plugin-vue": "^8.0.3",
5052
"rollup": "^2.39.1",
51-
"rollup-plugin-terser": "^7.0.2",
52-
"rollup-plugin-typescript2": "^0.30.0",
5353
"rollup-plugin-vue": "^6.0.0",
5454
"ts-jest": "^27.1.5",
5555
"typescript": "~4.5.5",

0 commit comments

Comments
 (0)