I would like to ask rollup how to make ts do not prompt errors for the variables defined in intro.

// main.ts
console.log(__VERSION__);
Does

have such a similar function / tslint:disable /

There is something wrong with the thinking before

. Referring to the source code of vue, you can replace the string through rollup-plugin-replace , and directly represent the place marked as the version with a string (such as: console.log ('_ VERSION__')). Write a paragraph in rollup.config.js to get the logic of the version field in package.json. Ok for replacement

Menu