@clikvn/showroom-visualizer 0.2.2-dev-11 → 0.2.2-dev-12
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/web.js +1 -1
- package/package.json +1 -1
- package/rollup.config.js +64 -2
package/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -301,7 +301,68 @@ const browserConfig = {
|
|
|
301
301
|
// ❌ KHÔNG external React - Bundle React version 19 vào file
|
|
302
302
|
// external: [], // Không khai báo external = bundle tất cả
|
|
303
303
|
onwarn: indexConfig.onwarn,
|
|
304
|
-
plugins:
|
|
304
|
+
plugins: [
|
|
305
|
+
resolve({
|
|
306
|
+
browser: true,
|
|
307
|
+
extensions: ['.ts', '.tsx', '.js'],
|
|
308
|
+
dedupe: ['react', 'react-dom'],
|
|
309
|
+
preferBuiltins: false,
|
|
310
|
+
}),
|
|
311
|
+
|
|
312
|
+
commonjs({
|
|
313
|
+
esmExternals: true,
|
|
314
|
+
requireReturnsDefault: 'auto',
|
|
315
|
+
}),
|
|
316
|
+
|
|
317
|
+
json(),
|
|
318
|
+
!isDev &&
|
|
319
|
+
babel({
|
|
320
|
+
babelHelpers: 'bundled',
|
|
321
|
+
extensions: ['.ts', '.tsx', '.js'],
|
|
322
|
+
exclude: 'node_modules/**',
|
|
323
|
+
}),
|
|
324
|
+
|
|
325
|
+
replace({
|
|
326
|
+
'process.env.NODE_ENV': JSON.stringify(
|
|
327
|
+
isDev ? 'development' : 'production'
|
|
328
|
+
),
|
|
329
|
+
preventAssignment: true,
|
|
330
|
+
}),
|
|
331
|
+
|
|
332
|
+
postcss({
|
|
333
|
+
plugins: [autoprefixer(), tailwindcss()],
|
|
334
|
+
extract: false,
|
|
335
|
+
modules: false,
|
|
336
|
+
autoModules: false,
|
|
337
|
+
minimize: !isDev,
|
|
338
|
+
inject: false,
|
|
339
|
+
}),
|
|
340
|
+
|
|
341
|
+
typescript({
|
|
342
|
+
sourceMap: isDev,
|
|
343
|
+
inlineSources: isDev,
|
|
344
|
+
}),
|
|
345
|
+
|
|
346
|
+
typescriptPaths({ preserveExtensions: true }),
|
|
347
|
+
!isDev &&
|
|
348
|
+
terser({
|
|
349
|
+
format: { comments: false },
|
|
350
|
+
}),
|
|
351
|
+
|
|
352
|
+
copy({
|
|
353
|
+
targets: [
|
|
354
|
+
{
|
|
355
|
+
src: [
|
|
356
|
+
'src/assets/fonts/icomoon.woff',
|
|
357
|
+
'src/assets/fonts/icomoon.ttf',
|
|
358
|
+
'src/assets/fonts/icomoon.svg',
|
|
359
|
+
'src/assets/fonts/icomoon.eot',
|
|
360
|
+
],
|
|
361
|
+
dest: 'fonts',
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
}),
|
|
365
|
+
].filter(Boolean),
|
|
305
366
|
};
|
|
306
367
|
|
|
307
368
|
// ============================================================================
|
|
@@ -323,7 +384,8 @@ const configs = [
|
|
|
323
384
|
// - Cần customize components qua custom layout overrides
|
|
324
385
|
// - Muốn kiểm soát React version
|
|
325
386
|
{
|
|
326
|
-
input: './src/index.ts',
|
|
387
|
+
input: './src/index.ts', // ⭐ IMPORTANT: Do NOT bundle react / react-dom
|
|
388
|
+
external: ['react', 'react-dom', 'react/jsx-runtime'],
|
|
327
389
|
output: {
|
|
328
390
|
file: 'dist/index.js',
|
|
329
391
|
format: 'esm',
|