vite-plugin-strip-comments 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
  [![ci](https://github.com/thednp/vite-plugin-strip-comments/actions/workflows/ci.yml/badge.svg)](https://github.com/thednp/vite-plugin-strip-comments/actions/workflows/ci.yml)
5
5
  [![NPM Version](https://img.shields.io/npm/v/vite-plugin-strip-comments.svg)](https://www.npmjs.com/package/vite-plugin-strip-comments)
6
6
  [![NPM Downloads](https://img.shields.io/npm/dm/vite-plugin-strip-comments.svg)](http://npm-stat.com/charts.html?package=vite-plugin-strip-comments)
7
- [![typescript version](https://img.shields.io/badge/typescript-5.7.3-brightgreen)](https://www.typescriptlang.org/)
8
- [![vitest version](https://img.shields.io/badge/vitest-2.1.8-brightgreen)](https://vitest.dev/)
9
- [![vite version](https://img.shields.io/badge/vite-5.4.11-brightgreen)](https://github.com/vitejs)
7
+ [![typescript version](https://img.shields.io/badge/typescript-5.8.3-brightgreen)](https://www.typescriptlang.org/)
8
+ [![vitest version](https://img.shields.io/badge/vitest-3.1.4-brightgreen)](https://vitest.dev/)
9
+ [![vite version](https://img.shields.io/badge/vite-6.3.5-brightgreen)](https://github.com/vitejs)
10
10
 
11
11
  A very simple Vite plugin for stripping comments in your production code. Some comments just don't get removed no matter what minify options you set, especially `/* istanbul ignore */` flags. Keep in mind this is experimental, please **use with caution**.
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-strip-comments",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "🗃️ Vite plugin for stripping comments in production builds",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -28,12 +28,12 @@
28
28
  },
29
29
  "homepage": "https://github.com/thednp/vite-plugin-strip-comments#readme",
30
30
  "devDependencies": {
31
- "@types/node": "^22.10.6",
32
- "@vitest/coverage-istanbul": "^2.1.8",
33
- "typescript": "^5.7.3",
34
- "vite": "^5.4.11",
35
- "vite-plugin-dts": "^4.5.0",
36
- "vitest": "^2.1.8"
31
+ "@types/node": "^22.15.24",
32
+ "@vitest/coverage-istanbul": "^3.1.4",
33
+ "typescript": "^5.8.3",
34
+ "vite": "^6.3.5",
35
+ "vite-plugin-dts": "^4.5.4",
36
+ "vitest": "^3.1.4"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=20",
@@ -43,7 +43,7 @@
43
43
  "scripts": {
44
44
  "pre-test": "pnpm clean-coverage",
45
45
  "badges": "npx -p dependency-version-badge update-badge typescript vitest vite",
46
- "test": "pnpm pre-test && vitest --config vitest.config.mts",
46
+ "test": "pnpm pre-test && vitest --config vitest.config.ts",
47
47
  "clean-coverage": "rm -rf coverage .nyc_output",
48
48
  "format": "deno fmt src",
49
49
  "lint": "pnpm lint:ts && pnpm check:ts",
package/vite.config.ts ADDED
@@ -0,0 +1,39 @@
1
+ import { resolve } from 'node:path';
2
+ import { defineConfig } from 'vite';
3
+ import dts from "vite-plugin-dts";
4
+ import strip from './src/index';
5
+
6
+ const NAME = 'VitePluginStripComments';
7
+
8
+ const fileName = {
9
+ es: `index.mjs`,
10
+ cjs: `index.cjs`,
11
+ };
12
+
13
+ export default defineConfig({
14
+ base: './',
15
+ esbuild: {
16
+ legalComments: 'none',
17
+ },
18
+ plugins: [
19
+ dts({
20
+ outDir: 'dist',
21
+ copyDtsFiles: true,
22
+ rollupTypes: true,
23
+ }),
24
+ strip(),
25
+ ],
26
+ build: {
27
+ minify: 'esbuild',
28
+ emptyOutDir: true,
29
+ outDir: 'dist',
30
+ target: 'ESNext',
31
+ lib: {
32
+ entry: resolve(__dirname, 'src/index.ts'),
33
+ name: NAME,
34
+ formats: ['es', 'cjs'],
35
+ fileName: (format) => fileName[format],
36
+ },
37
+ sourcemap: true,
38
+ },
39
+ });
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ optimizeDeps: {
5
+ include: [
6
+ "@vitest/coverage-istanbul"
7
+ ]
8
+ },
9
+ esbuild: {
10
+ legalComments: 'inline',
11
+ },
12
+ build: {
13
+ minify: 'esbuild',
14
+ },
15
+ test: {
16
+ css: true,
17
+ globals: true,
18
+ coverage: {
19
+ provider: "istanbul",
20
+ reporter: ["html", "text", "lcov"],
21
+ enabled: true,
22
+ include: ["src/**/*.{ts,tsx}"],
23
+ },
24
+ },
25
+ });