enable preventAssignment
This commit is contained in:
parent
9dcef380f4
commit
7c9dc72df1
2 changed files with 17 additions and 16 deletions
|
@ -1,35 +1,36 @@
|
|||
import replace from "@rollup/plugin-replace";
|
||||
import terser from "@rollup/plugin-terser";
|
||||
import typescript from "@rollup/plugin-typescript";
|
||||
import pkg from "./package.json" assert { type: "json" };
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import terser from '@rollup/plugin-terser';
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import pkg from './package.json' assert { type: 'json' };
|
||||
|
||||
const plugins = [
|
||||
terser(),
|
||||
replace({
|
||||
"env.PKG_VERSION": pkg.version,
|
||||
'env.PKG_VERSION': pkg.version,
|
||||
preventAssignment: true,
|
||||
}),
|
||||
typescript({
|
||||
tsconfig: "./tsconfig.json",
|
||||
moduleResolution: "node",
|
||||
tsconfig: './tsconfig.json',
|
||||
moduleResolution: 'node',
|
||||
}),
|
||||
];
|
||||
|
||||
const cjs = {
|
||||
input: "./src/index.ts",
|
||||
input: './src/index.ts',
|
||||
output: {
|
||||
dir: "./dist",
|
||||
entryFileNames: "[name].js",
|
||||
format: "cjs",
|
||||
dir: './dist',
|
||||
entryFileNames: '[name].js',
|
||||
format: 'cjs',
|
||||
},
|
||||
plugins,
|
||||
};
|
||||
|
||||
const es = {
|
||||
input: "./src/index.ts",
|
||||
input: './src/index.ts',
|
||||
output: {
|
||||
dir: "./dist",
|
||||
entryFileNames: "[name].mjs",
|
||||
format: "es",
|
||||
dir: './dist',
|
||||
entryFileNames: '[name].mjs',
|
||||
format: 'es',
|
||||
},
|
||||
plugins,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue