@sylphx/silk-vite-plugin 1.1.1 ā 2.0.0
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/dist/index.d.ts +22 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +172 -186
- package/package.json +8 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @sylphx/silk-vite-plugin
|
|
3
|
-
*
|
|
3
|
+
* Universal plugin for zero-runtime Silk CSS-in-TypeScript
|
|
4
|
+
*
|
|
5
|
+
* Uses unplugin for cross-bundler compatibility
|
|
4
6
|
*/
|
|
5
|
-
import type { Plugin } from 'vite';
|
|
6
7
|
export interface CompressionOptions {
|
|
7
8
|
/**
|
|
8
9
|
* Enable Brotli compression (.css.br)
|
|
9
|
-
* 15-25% smaller than gzip, 70% compression for CSS
|
|
10
10
|
* @default true
|
|
11
11
|
*/
|
|
12
12
|
brotli?: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Brotli quality (0-11
|
|
15
|
-
* Use 11 for production (static compression, no runtime cost)
|
|
14
|
+
* Brotli quality (0-11)
|
|
16
15
|
* @default 11
|
|
17
16
|
*/
|
|
18
17
|
brotliQuality?: number;
|
|
19
18
|
/**
|
|
20
19
|
* Enable gzip compression (.css.gz)
|
|
21
|
-
* Fallback for older servers
|
|
22
20
|
* @default true
|
|
23
21
|
*/
|
|
24
22
|
gzip?: boolean;
|
|
@@ -30,37 +28,37 @@ export interface CompressionOptions {
|
|
|
30
28
|
}
|
|
31
29
|
export interface SilkPluginOptions {
|
|
32
30
|
/**
|
|
33
|
-
* Output CSS file path
|
|
31
|
+
* Output CSS file path
|
|
34
32
|
* @default 'silk.css'
|
|
35
33
|
*/
|
|
36
34
|
outputFile?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Include CSS in HTML automatically
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
inject?: boolean;
|
|
42
35
|
/**
|
|
43
36
|
* Minify CSS output
|
|
44
37
|
* @default true in production
|
|
45
38
|
*/
|
|
46
39
|
minify?: boolean;
|
|
47
40
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @default true
|
|
41
|
+
* Pre-compression options
|
|
50
42
|
*/
|
|
51
|
-
|
|
43
|
+
compression?: CompressionOptions;
|
|
52
44
|
/**
|
|
53
|
-
*
|
|
54
|
-
* Generates .br and .gz files for web servers
|
|
55
|
-
* @default { brotli: true, gzip: true }
|
|
45
|
+
* Babel plugin options
|
|
56
46
|
*/
|
|
57
|
-
|
|
47
|
+
babelOptions?: {
|
|
48
|
+
production?: boolean;
|
|
49
|
+
classPrefix?: string;
|
|
50
|
+
importSources?: string[];
|
|
51
|
+
tokens?: Record<string, any>;
|
|
52
|
+
breakpoints?: Record<string, string>;
|
|
53
|
+
};
|
|
58
54
|
}
|
|
59
|
-
export declare function silk(options?: SilkPluginOptions): Plugin;
|
|
60
|
-
export default silk;
|
|
61
55
|
/**
|
|
62
|
-
*
|
|
63
|
-
* This should be imported in the app entry point
|
|
56
|
+
* Silk unplugin instance
|
|
64
57
|
*/
|
|
65
|
-
export declare const
|
|
58
|
+
export declare const unpluginSilk: import("unplugin").UnpluginInstance<SilkPluginOptions, boolean>;
|
|
59
|
+
export declare const vite: (options: SilkPluginOptions) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
|
|
60
|
+
export declare const webpack: (options: SilkPluginOptions) => WebpackPluginInstance;
|
|
61
|
+
export declare const rollup: (options: SilkPluginOptions) => import("rollup").Plugin<any> | import("rollup").Plugin<any>[];
|
|
62
|
+
export declare const esbuild: (options: SilkPluginOptions) => import("unplugin").EsbuildPlugin;
|
|
63
|
+
export default vite;
|
|
66
64
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACrC,CAAA;CACF;AAyBD;;GAEG;AACH,eAAO,MAAM,YAAY,iEA0LvB,CAAA;AAGF,eAAO,MAAM,IAAI,2FAAoB,CAAA;AACrC,eAAO,MAAM,OAAO,uDAAuB,CAAA;AAC3C,eAAO,MAAM,MAAM,+FAAsB,CAAA;AACzC,eAAO,MAAM,OAAO,kEAAuB,CAAA;AAG3C,eAAe,IAAI,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,216 +1,202 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @sylphx/silk-vite-plugin
|
|
3
|
-
*
|
|
3
|
+
* Universal plugin for zero-runtime Silk CSS-in-TypeScript
|
|
4
|
+
*
|
|
5
|
+
* Uses unplugin for cross-bundler compatibility
|
|
4
6
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { gzipSync } from 'node:zlib';
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { createUnplugin } from 'unplugin';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import { gzipSync, brotliCompressSync, constants } from 'node:zlib';
|
|
10
|
+
// @ts-ignore - Babel preset types not needed
|
|
11
|
+
import presetReact from '@babel/preset-react';
|
|
12
|
+
// @ts-ignore - Babel preset types not needed
|
|
13
|
+
import presetTypeScript from '@babel/preset-typescript';
|
|
14
|
+
// Global CSS registry
|
|
15
|
+
const cssRules = new Map();
|
|
16
|
+
/**
|
|
17
|
+
* Minify CSS
|
|
18
|
+
*/
|
|
19
|
+
function minifyCSS(css) {
|
|
20
|
+
return css
|
|
21
|
+
.replace(/\s+/g, ' ')
|
|
22
|
+
.replace(/\s*([{}:;,])\s*/g, '$1')
|
|
23
|
+
.replace(/;}/g, '}')
|
|
24
|
+
.trim();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Format bytes
|
|
28
|
+
*/
|
|
29
|
+
function formatBytes(bytes) {
|
|
30
|
+
if (bytes < 1024)
|
|
31
|
+
return `${bytes}B`;
|
|
32
|
+
if (bytes < 1024 * 1024)
|
|
33
|
+
return `${(bytes / 1024).toFixed(1)}KB`;
|
|
34
|
+
return `${(bytes / 1024 / 1024).toFixed(1)}MB`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Silk unplugin instance
|
|
38
|
+
*/
|
|
39
|
+
export const unpluginSilk = createUnplugin((options = {}) => {
|
|
40
|
+
const { outputFile = 'silk.css', minify: shouldMinify, compression = {}, babelOptions = {}, } = options;
|
|
10
41
|
const compressionConfig = {
|
|
11
42
|
brotli: compression.brotli ?? true,
|
|
12
43
|
brotliQuality: compression.brotliQuality ?? 11,
|
|
13
44
|
gzip: compression.gzip ?? true,
|
|
14
45
|
gzipLevel: compression.gzipLevel ?? 9,
|
|
15
46
|
};
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (compressionConfig.brotli) {
|
|
26
|
-
try {
|
|
27
|
-
const compressed = await compress(Buffer.from(css, 'utf-8'), {
|
|
28
|
-
quality: compressionConfig.brotliQuality,
|
|
29
|
-
});
|
|
30
|
-
outputs.push({
|
|
31
|
-
fileName: `${fileName}.br`,
|
|
32
|
-
source: Buffer.from(compressed),
|
|
33
|
-
});
|
|
47
|
+
let isProduction = false;
|
|
48
|
+
return {
|
|
49
|
+
name: 'unplugin-silk',
|
|
50
|
+
enforce: 'pre', // Run before other plugins
|
|
51
|
+
// Only transform TypeScript/JSX files
|
|
52
|
+
transformInclude(id) {
|
|
53
|
+
// Skip node_modules and virtual modules
|
|
54
|
+
if (id.includes('node_modules') || id.includes('\0')) {
|
|
55
|
+
return false;
|
|
34
56
|
}
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
return /\.[jt]sx?$/.test(id);
|
|
58
|
+
},
|
|
59
|
+
// Transform code with Babel
|
|
60
|
+
async transform(code, id) {
|
|
61
|
+
// Skip if no silk imports
|
|
62
|
+
if (!code.includes('@sylphx/silk')) {
|
|
63
|
+
return null;
|
|
37
64
|
}
|
|
38
|
-
}
|
|
39
|
-
// Generate gzip (.gz)
|
|
40
|
-
if (compressionConfig.gzip) {
|
|
41
65
|
try {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
66
|
+
// Dynamic import to avoid bundling
|
|
67
|
+
const { transformSync } = await import('@babel/core');
|
|
68
|
+
const babelPluginSilk = (await import('@sylphx/babel-plugin-silk')).default;
|
|
69
|
+
// Set production mode if not explicitly set
|
|
70
|
+
const babelOpts = {
|
|
71
|
+
...babelOptions,
|
|
72
|
+
production: babelOptions.production ?? isProduction,
|
|
73
|
+
};
|
|
74
|
+
// Transform with Babel plugin
|
|
75
|
+
const result = transformSync(code, {
|
|
76
|
+
filename: id,
|
|
77
|
+
presets: [
|
|
78
|
+
[presetReact, { runtime: 'automatic' }],
|
|
79
|
+
[presetTypeScript, { isTSX: true, allExtensions: true }],
|
|
80
|
+
],
|
|
81
|
+
plugins: [[babelPluginSilk, babelOpts]],
|
|
82
|
+
sourceMaps: true,
|
|
83
|
+
configFile: false,
|
|
84
|
+
babelrc: false,
|
|
46
85
|
});
|
|
86
|
+
if (!result || !result.code) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
// Extract CSS from metadata
|
|
90
|
+
const metadata = result.metadata;
|
|
91
|
+
if (metadata?.silk?.cssRules) {
|
|
92
|
+
for (const [className, rule] of metadata.silk.cssRules) {
|
|
93
|
+
cssRules.set(className, rule);
|
|
94
|
+
}
|
|
95
|
+
// Log in dev mode
|
|
96
|
+
if (!isProduction && metadata.silk.cssRules.length > 0) {
|
|
97
|
+
console.log(`[Silk] Compiled ${metadata.silk.cssRules.length} CSS rules from ${path.basename(id)}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
code: result.code,
|
|
102
|
+
map: result.map || undefined,
|
|
103
|
+
};
|
|
47
104
|
}
|
|
48
105
|
catch (error) {
|
|
49
|
-
console.
|
|
106
|
+
console.error(`[Silk] Transform error in ${id}:`, error);
|
|
107
|
+
return null;
|
|
50
108
|
}
|
|
51
|
-
}
|
|
52
|
-
return outputs;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Collect CSS rules from runtime
|
|
56
|
-
*/
|
|
57
|
-
function collectCSS() {
|
|
58
|
-
const rules = [];
|
|
59
|
-
for (const [className, rule] of cssRules) {
|
|
60
|
-
if (!cssCache.has(className)) {
|
|
61
|
-
rules.push(rule);
|
|
62
|
-
cssCache.add(className);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return rules.join('\n');
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Minify CSS (basic implementation)
|
|
69
|
-
*/
|
|
70
|
-
function minifyCSS(css) {
|
|
71
|
-
return css
|
|
72
|
-
.replace(/\s+/g, ' ')
|
|
73
|
-
.replace(/\s*([{}:;,])\s*/g, '$1')
|
|
74
|
-
.replace(/;}/g, '}')
|
|
75
|
-
.trim();
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Generate CSS output
|
|
79
|
-
*/
|
|
80
|
-
function generateCSS() {
|
|
81
|
-
let css = collectCSS();
|
|
82
|
-
if (minify ?? isBuild) {
|
|
83
|
-
css = minifyCSS(css);
|
|
84
|
-
}
|
|
85
|
-
return css;
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
name: 'silk',
|
|
89
|
-
configResolved(config) {
|
|
90
|
-
isBuild = config.command === 'build';
|
|
91
|
-
},
|
|
92
|
-
configureServer(_server) {
|
|
93
|
-
server = _server;
|
|
94
|
-
// Hot reload CSS in dev mode
|
|
95
|
-
if (watch) {
|
|
96
|
-
const watcher = setInterval(() => {
|
|
97
|
-
const newCSS = collectCSS();
|
|
98
|
-
if (newCSS) {
|
|
99
|
-
server?.ws.send({
|
|
100
|
-
type: 'custom',
|
|
101
|
-
event: 'silk:update',
|
|
102
|
-
data: { css: newCSS },
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}, 100);
|
|
106
|
-
server.httpServer?.on('close', () => {
|
|
107
|
-
clearInterval(watcher);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
transformIndexHtml: {
|
|
112
|
-
order: 'post',
|
|
113
|
-
handler(html) {
|
|
114
|
-
if (!inject)
|
|
115
|
-
return html;
|
|
116
|
-
const css = generateCSS();
|
|
117
|
-
if (!css)
|
|
118
|
-
return html;
|
|
119
|
-
// Inject CSS into head
|
|
120
|
-
const styleTag = `<style data-silk>${css}</style>`;
|
|
121
|
-
if (html.includes('</head>')) {
|
|
122
|
-
return html.replace('</head>', `${styleTag}\n</head>`);
|
|
123
|
-
}
|
|
124
|
-
return `${styleTag}\n${html}`;
|
|
125
|
-
},
|
|
126
109
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const css = generateCSS();
|
|
131
|
-
if (!css)
|
|
110
|
+
// Universal hook - works for all bundlers
|
|
111
|
+
async generateBundle() {
|
|
112
|
+
if (cssRules.size === 0)
|
|
132
113
|
return;
|
|
114
|
+
// Generate CSS
|
|
115
|
+
let css = Array.from(cssRules.values()).join('\n');
|
|
116
|
+
if (shouldMinify ?? isProduction) {
|
|
117
|
+
css = minifyCSS(css);
|
|
118
|
+
}
|
|
133
119
|
// Emit main CSS file
|
|
134
120
|
this.emitFile({
|
|
135
121
|
type: 'asset',
|
|
136
122
|
fileName: outputFile,
|
|
137
123
|
source: css,
|
|
138
124
|
});
|
|
139
|
-
// Generate
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
125
|
+
// Generate compressed versions
|
|
126
|
+
if (isProduction) {
|
|
127
|
+
const cssBuffer = Buffer.from(css, 'utf-8');
|
|
128
|
+
const originalSize = cssBuffer.length;
|
|
129
|
+
// Brotli compression
|
|
130
|
+
if (compressionConfig.brotli) {
|
|
131
|
+
try {
|
|
132
|
+
const compressed = brotliCompressSync(cssBuffer, {
|
|
133
|
+
params: {
|
|
134
|
+
[constants.BROTLI_PARAM_QUALITY]: compressionConfig.brotliQuality,
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
this.emitFile({
|
|
138
|
+
type: 'asset',
|
|
139
|
+
fileName: `${outputFile}.br`,
|
|
140
|
+
source: compressed,
|
|
141
|
+
});
|
|
142
|
+
const savings = ((1 - compressed.length / originalSize) * 100).toFixed(1);
|
|
143
|
+
console.log(`[Silk] Brotli: ${formatBytes(compressed.length)} (-${savings}%)`);
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
console.warn('[Silk] Brotli compression failed:', error);
|
|
147
|
+
}
|
|
158
148
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.
|
|
149
|
+
// Gzip compression
|
|
150
|
+
if (compressionConfig.gzip) {
|
|
151
|
+
try {
|
|
152
|
+
const compressed = gzipSync(cssBuffer, {
|
|
153
|
+
level: compressionConfig.gzipLevel,
|
|
154
|
+
});
|
|
155
|
+
this.emitFile({
|
|
156
|
+
type: 'asset',
|
|
157
|
+
fileName: `${outputFile}.gz`,
|
|
158
|
+
source: compressed,
|
|
159
|
+
});
|
|
160
|
+
const savings = ((1 - compressed.length / originalSize) * 100).toFixed(1);
|
|
161
|
+
console.log(`[Silk] Gzip: ${formatBytes(compressed.length)} (-${savings}%)`);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
console.warn('[Silk] Gzip compression failed:', error);
|
|
165
|
+
}
|
|
172
166
|
}
|
|
167
|
+
// Summary
|
|
168
|
+
console.log(`\nš¦ Silk CSS Bundle:`);
|
|
169
|
+
console.log(` Original: ${formatBytes(originalSize)} (${outputFile})`);
|
|
170
|
+
console.log(` Rules: ${cssRules.size} atomic classes\n`);
|
|
173
171
|
}
|
|
174
172
|
},
|
|
175
|
-
//
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
173
|
+
// Vite-specific hooks
|
|
174
|
+
vite: {
|
|
175
|
+
configResolved(config) {
|
|
176
|
+
isProduction = config.command === 'build' && config.mode === 'production';
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
// Webpack-specific hooks
|
|
180
|
+
webpack(compiler) {
|
|
181
|
+
compiler.hooks.emit.tapPromise('SilkPlugin', async (compilation) => {
|
|
182
|
+
if (cssRules.size === 0)
|
|
183
|
+
return;
|
|
184
|
+
let css = Array.from(cssRules.values()).join('\n');
|
|
185
|
+
if (shouldMinify ?? true) {
|
|
186
|
+
css = minifyCSS(css);
|
|
187
|
+
}
|
|
188
|
+
compilation.assets[outputFile] = {
|
|
189
|
+
source: () => css,
|
|
190
|
+
size: () => css.length,
|
|
191
|
+
};
|
|
192
|
+
});
|
|
186
193
|
},
|
|
187
194
|
};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
import.meta.hot.on('silk:update', ({ css }) => {
|
|
197
|
-
let style = document.querySelector('style[data-silk]')
|
|
198
|
-
if (!style) {
|
|
199
|
-
style = document.createElement('style')
|
|
200
|
-
style.setAttribute('data-silk', '')
|
|
201
|
-
document.head.appendChild(style)
|
|
202
|
-
}
|
|
203
|
-
style.textContent = css
|
|
204
|
-
})
|
|
205
|
-
}
|
|
206
|
-
`;
|
|
207
|
-
/**
|
|
208
|
-
* Format bytes to human-readable format
|
|
209
|
-
*/
|
|
210
|
-
function formatBytes(bytes) {
|
|
211
|
-
if (bytes < 1024)
|
|
212
|
-
return `${bytes}B`;
|
|
213
|
-
if (bytes < 1024 * 1024)
|
|
214
|
-
return `${(bytes / 1024).toFixed(1)}KB`;
|
|
215
|
-
return `${(bytes / 1024 / 1024).toFixed(1)}MB`;
|
|
216
|
-
}
|
|
195
|
+
});
|
|
196
|
+
// Export for different bundlers
|
|
197
|
+
export const vite = unpluginSilk.vite;
|
|
198
|
+
export const webpack = unpluginSilk.webpack;
|
|
199
|
+
export const rollup = unpluginSilk.rollup;
|
|
200
|
+
export const esbuild = unpluginSilk.esbuild;
|
|
201
|
+
// Default export for Vite
|
|
202
|
+
export default vite;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/silk-vite-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vite plugin for Silk - Build-time CSS extraction with production optimizations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"silk",
|
|
@@ -40,10 +40,15 @@
|
|
|
40
40
|
"prepublishOnly": "bun run build"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@
|
|
43
|
+
"@babel/core": "^7.23.0",
|
|
44
|
+
"@babel/preset-react": "^7.23.0",
|
|
45
|
+
"@babel/preset-typescript": "^7.23.0",
|
|
46
|
+
"@sylphx/babel-plugin-silk": "workspace:*",
|
|
47
|
+
"@sylphx/silk": "workspace:*",
|
|
48
|
+
"unplugin": "^2.3.10"
|
|
44
49
|
},
|
|
45
50
|
"devDependencies": {
|
|
46
|
-
"
|
|
51
|
+
"@types/babel__core": "^7.20.5",
|
|
47
52
|
"typescript": "^5.3.0",
|
|
48
53
|
"vite": "^5.0.0"
|
|
49
54
|
},
|