@blocklet/pages-kit-block-studio 0.1.40 → 0.4.23

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.
@@ -18,6 +18,7 @@ import externalGlobals from 'rollup-plugin-external-globals';
18
18
  // import { visualizer } from 'rollup-plugin-visualizer';
19
19
  import ts from 'typescript';
20
20
  import { joinURL } from 'ufo';
21
+ import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
21
22
  import { nodePolyfills } from 'vite-plugin-node-polyfills';
22
23
  import pages, { DefaultPageStrategy } from 'vite-plugin-react-pages';
23
24
  import { findComponentFiles, setBlockEntryFilesPattern, getBlockEntryFilesPattern, getBlockName, logger, } from '../utils/helper';
@@ -151,7 +152,7 @@ export function initBlockStudioPlugins(options) {
151
152
  },
152
153
  build: Object.assign(Object.assign({}, _config === null || _config === void 0 ? void 0 : _config.build), {
153
154
  // sourcemap: true,
154
- cssCodeSplit: false, lib: {
155
+ cssCodeSplit: true, lib: {
155
156
  name,
156
157
  entry: Object.assign({}, Object.fromEntries(entryList)),
157
158
  formats,
@@ -221,6 +222,8 @@ export function initBlockStudioPlugins(options) {
221
222
  }),
222
223
  }),
223
224
  }),
225
+ initHtmlPreviewTransformPlugin(),
226
+ cssInjectedByJsPlugin(),
224
227
  // https://github.com/rollup/plugins/tree/master/packages/typescript#noforceemit
225
228
  // typescript({
226
229
  // declaration: true,
@@ -229,14 +232,13 @@ export function initBlockStudioPlugins(options) {
229
232
  // declarationDir: path.resolve(workingDir, 'lib/types'),
230
233
  // rootDir: path.resolve(workingDir),
231
234
  // }),
232
- initHtmlPreviewTransformPlugin(),
233
235
  // initRemoteScriptLocalizerPlugin({
234
236
  // tempDir: 'temp/remote-scripts', // 可选,默认值
235
237
  // maxConcurrent: 5, // 可选,默认值
236
238
  // timeout: 30 * 1000, // 可选,默认值 30 秒
237
239
  // }),
238
240
  {
239
- name: 'build-force-exit',
241
+ name: 'post-build-file-transpiler',
240
242
  apply: 'build',
241
243
  enforce: 'post',
242
244
  writeBundle(options) {