ninegrid2 6.1285.0 → 6.1287.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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/rollup.config.js +23 -11
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1285.0",
4
+ "version": "6.1287.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -20,6 +20,7 @@
20
20
  "description": "",
21
21
  "devDependencies": {
22
22
  "@rollup/plugin-commonjs": "^28.0.3",
23
+ "@rollup/plugin-image": "^3.0.3",
23
24
  "@rollup/plugin-json": "^6.1.0",
24
25
  "@rollup/plugin-node-resolve": "^16.0.1",
25
26
  "@rollup/plugin-url": "^8.0.2",
package/rollup.config.js CHANGED
@@ -3,6 +3,7 @@ import commonjs from "@rollup/plugin-commonjs";
3
3
  import postcss from 'rollup-plugin-postcss';
4
4
  import json from '@rollup/plugin-json';
5
5
  import url from '@rollup/plugin-url';
6
+ // string 플러그인이 문제를 일으키면 아래 설정을 확인하세요.
6
7
  import { string } from 'rollup-plugin-string';
7
8
 
8
9
  export default {
@@ -23,36 +24,47 @@ export default {
23
24
  ],
24
25
  external: [],
25
26
  plugins: [
26
- // 1. JSON 파일 처리 (CKEditor 내부 설정 로드용)
27
+ // 1. JSON (최상단)
27
28
  json(),
28
29
 
29
- // 2. SVG 아이콘 처리 (문자열로 읽어서 CKEditor 아이콘 주입)
30
+ // 2. SVG 처리 (순수 문자열 유지)
31
+ // 만약 여전히 invalid-svg가 뜬다면 이 플러그인을 빼고
32
+ // npm install -D @rollup/plugin-image 설치 후 image({ include: '**/*.svg' })로 교체하세요.
30
33
  string({
31
34
  include: '**/*.svg',
32
35
  }),
33
36
 
34
- // 3. 이미지 및 기타 에셋 처리
37
+ // 3. 이미지 에셋
35
38
  url({
39
+ // ⭐ 중요: SVG가 url 플러그인에 의해 Base64로 변하지 않도록 확실히 제외합니다.
40
+ exclude: '**/*.svg',
36
41
  include: ['**/*.png', '**/*.jpg', '**/*.gif'],
37
42
  limit: 8192,
38
43
  }),
39
44
 
40
- // 4. CSS PostCSS 처리
45
+ // 4. CSS (CKEditor 스타일 주입)
41
46
  postcss({
42
- extract: false, // Shadow DOM 환경이므로 JS에 내장하여 주입하는 것이 유리함
47
+ extract: false,
43
48
  minimize: true,
44
- // CKEditor Sass를 쓰지 않으므로 필요 없다면 생략 가능하지만,
45
- // 기존 설정 유지 및 범용성을 위해 남겨둡니다.
49
+ // CKEditor 모듈 내의 CSS를 처리하기 위해 필수
50
+ modules: false,
46
51
  use: ['sass'],
47
52
  }),
48
53
 
49
- // 5. 모듈 해석 (브라우저 환경 우선)
54
+ // 5. 모듈 해석
50
55
  resolve({
51
56
  browser: true,
52
- preferBuiltins: false
57
+ preferBuiltins: false,
58
+ // CKEditor 5는 ESM 우선이므로 module 필드를 먼저 읽어야 합니다.
59
+ mainFields: ['module', 'main']
53
60
  }),
54
61
 
55
- // 6. CommonJS 변환
56
- commonjs(),
62
+ // 6. CommonJS (순서 중요: resolve 뒤에 배치)
63
+ commonjs({
64
+ // CKEditor의 일부 레거시 코드를 처리
65
+ include: /node_modules/,
66
+ // SVG 문자열이 CommonJS로 변환되는 것을 방지하기 위해 확장자 명시 권장
67
+ extensions: ['.js', '.cjs']
68
+ }),
57
69
  ]
58
70
  };