ninegrid2 6.1286.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 +17 -11
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1286.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,7 +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 대신 텍스트 처리가 확실한 raw 플러그인이나 설정을 사용합니다.
6
+ // string 플러그인이 문제를 일으키면 아래 설정을 확인하세요.
7
7
  import { string } from 'rollup-plugin-string';
8
8
 
9
9
  export default {
@@ -24,41 +24,47 @@ export default {
24
24
  ],
25
25
  external: [],
26
26
  plugins: [
27
- // 1. JSON (최상단 유지)
27
+ // 1. JSON (최상단)
28
28
  json(),
29
29
 
30
- // 2. SVG 처리 (순수 문자열로 읽기)
31
- // CKEditor 5 아이콘 에러 해결의 핵심입니다.
30
+ // 2. SVG 처리 (순수 문자열 유지)
31
+ // 만약 여전히 invalid-svg가 뜬다면 플러그인을 빼고
32
+ // npm install -D @rollup/plugin-image 설치 후 image({ include: '**/*.svg' })로 교체하세요.
32
33
  string({
33
34
  include: '**/*.svg',
34
35
  }),
35
36
 
36
- // 3. 이미지 에셋 (SVG는 제외시켜서 충돌 방지)
37
+ // 3. 이미지 에셋
37
38
  url({
38
- exclude: '**/*.svg', // ⭐ SVG 위에서 string이 처리하도록 제외
39
+ // ⭐ 중요: SVG url 플러그인에 의해 Base64로 변하지 않도록 확실히 제외합니다.
40
+ exclude: '**/*.svg',
39
41
  include: ['**/*.png', '**/*.jpg', '**/*.gif'],
40
42
  limit: 8192,
41
43
  }),
42
44
 
43
- // 4. CSS
45
+ // 4. CSS (CKEditor 스타일 주입)
44
46
  postcss({
45
47
  extract: false,
46
48
  minimize: true,
49
+ // CKEditor 모듈 내의 CSS를 처리하기 위해 필수
50
+ modules: false,
47
51
  use: ['sass'],
48
52
  }),
49
53
 
50
- // 5. 해석 (browser: true 옵션은 CKEditor 모듈 해석에 필수)
54
+ // 5. 모듈 해석
51
55
  resolve({
52
56
  browser: true,
53
57
  preferBuiltins: false,
54
- // CKEditor는 'main' 대신 'module' 필드를 사용하는 경우가 많습니다.
58
+ // CKEditor 5ESM 우선이므로 module 필드를 먼저 읽어야 합니다.
55
59
  mainFields: ['module', 'main']
56
60
  }),
57
61
 
58
- // 6. CommonJS
62
+ // 6. CommonJS (순서 중요: resolve 뒤에 배치)
59
63
  commonjs({
60
- // CKEditor 아이콘(SVG)이 JS 모듈로 오해받지 않도록 범위 설정
64
+ // CKEditor 일부 레거시 코드를 처리
61
65
  include: /node_modules/,
66
+ // SVG 문자열이 CommonJS로 변환되는 것을 방지하기 위해 확장자 명시 권장
67
+ extensions: ['.js', '.cjs']
62
68
  }),
63
69
  ]
64
70
  };