@atlaspack/packager-css 2.14.5-canary.14 → 2.14.5-canary.141
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/CHANGELOG.md +130 -0
- package/lib/CSSPackager.d.ts +5 -0
- package/lib/CSSPackager.js +31 -6
- package/package.json +12 -8
- package/src/{CSSPackager.js → CSSPackager.ts} +49 -24
- package/tsconfig.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,135 @@
|
|
|
1
1
|
# @atlaspack/packager-css
|
|
2
2
|
|
|
3
|
+
## 2.14.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @atlaspack/utils@2.17.3
|
|
9
|
+
- @atlaspack/plugin@2.14.21
|
|
10
|
+
|
|
11
|
+
## 2.14.20
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#702](https://github.com/atlassian-labs/atlaspack/pull/702) [`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa) Thanks [@alshdavid](https://github.com/alshdavid)! - Fixes to Flow types
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
|
|
18
|
+
- @atlaspack/plugin@2.14.20
|
|
19
|
+
- @atlaspack/utils@2.17.2
|
|
20
|
+
|
|
21
|
+
## 2.14.19
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies []:
|
|
26
|
+
- @atlaspack/utils@2.17.1
|
|
27
|
+
- @atlaspack/plugin@2.14.19
|
|
28
|
+
|
|
29
|
+
## 2.14.18
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56)]:
|
|
34
|
+
- @atlaspack/utils@2.17.0
|
|
35
|
+
- @atlaspack/plugin@2.14.18
|
|
36
|
+
|
|
37
|
+
## 2.14.17
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies []:
|
|
42
|
+
- @atlaspack/utils@2.16.1
|
|
43
|
+
- @atlaspack/plugin@2.14.17
|
|
44
|
+
|
|
45
|
+
## 2.14.16
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
|
|
50
|
+
- @atlaspack/utils@2.16.0
|
|
51
|
+
- @atlaspack/plugin@2.14.16
|
|
52
|
+
|
|
53
|
+
## 2.14.15
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies []:
|
|
58
|
+
- @atlaspack/utils@2.15.3
|
|
59
|
+
- @atlaspack/plugin@2.14.15
|
|
60
|
+
|
|
61
|
+
## 2.14.14
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- Updated dependencies []:
|
|
66
|
+
- @atlaspack/utils@2.15.2
|
|
67
|
+
- @atlaspack/plugin@2.14.14
|
|
68
|
+
|
|
69
|
+
## 2.14.13
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies []:
|
|
74
|
+
- @atlaspack/utils@2.15.1
|
|
75
|
+
- @atlaspack/plugin@2.14.13
|
|
76
|
+
|
|
77
|
+
## 2.14.12
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
|
|
82
|
+
- @atlaspack/utils@2.15.0
|
|
83
|
+
- @atlaspack/plugin@2.14.12
|
|
84
|
+
|
|
85
|
+
## 2.14.11
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies []:
|
|
90
|
+
- @atlaspack/utils@2.14.11
|
|
91
|
+
- @atlaspack/plugin@2.14.11
|
|
92
|
+
|
|
93
|
+
## 2.14.10
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- Updated dependencies []:
|
|
98
|
+
- @atlaspack/plugin@2.14.10
|
|
99
|
+
- @atlaspack/utils@2.14.10
|
|
100
|
+
|
|
101
|
+
## 2.14.9
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- Updated dependencies []:
|
|
106
|
+
- @atlaspack/utils@2.14.9
|
|
107
|
+
- @atlaspack/plugin@2.14.9
|
|
108
|
+
|
|
109
|
+
## 2.14.8
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- Updated dependencies []:
|
|
114
|
+
- @atlaspack/utils@2.14.8
|
|
115
|
+
- @atlaspack/plugin@2.14.8
|
|
116
|
+
|
|
117
|
+
## 2.14.7
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- Updated dependencies []:
|
|
122
|
+
- @atlaspack/utils@2.14.7
|
|
123
|
+
- @atlaspack/plugin@2.14.7
|
|
124
|
+
|
|
125
|
+
## 2.14.6
|
|
126
|
+
|
|
127
|
+
### Patch Changes
|
|
128
|
+
|
|
129
|
+
- Updated dependencies []:
|
|
130
|
+
- @atlaspack/utils@2.14.6
|
|
131
|
+
- @atlaspack/plugin@2.14.6
|
|
132
|
+
|
|
3
133
|
## 2.14.5
|
|
4
134
|
|
|
5
135
|
### Patch Changes
|
package/lib/CSSPackager.js
CHANGED
|
@@ -57,7 +57,6 @@ function _utils() {
|
|
|
57
57
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
58
58
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
59
59
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
60
|
-
// $FlowFixMe - init for browser build.
|
|
61
60
|
var _default = exports.default = new (_plugin().Packager)({
|
|
62
61
|
async package({
|
|
63
62
|
bundle,
|
|
@@ -77,8 +76,10 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
77
76
|
let queue = new (_utils().PromiseQueue)({
|
|
78
77
|
maxConcurrent: 32
|
|
79
78
|
});
|
|
79
|
+
// @ts-expect-error TS2304
|
|
80
80
|
let hoistedImports = [];
|
|
81
81
|
let assetsByPlaceholder = new Map();
|
|
82
|
+
// @ts-expect-error TS7034
|
|
82
83
|
let entry = null;
|
|
83
84
|
let entryContents = '';
|
|
84
85
|
bundle.traverse({
|
|
@@ -86,6 +87,7 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
86
87
|
if (node.type === 'asset' && !context) {
|
|
87
88
|
// If there is only one entry, we'll use it directly.
|
|
88
89
|
// Otherwise, we'll create a fake bundle entry with @import rules for each root asset.
|
|
90
|
+
// @ts-expect-error TS7005
|
|
89
91
|
if (entry == null) {
|
|
90
92
|
entry = node.value.id;
|
|
91
93
|
} else {
|
|
@@ -144,14 +146,18 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
144
146
|
});
|
|
145
147
|
}
|
|
146
148
|
});
|
|
147
|
-
let outputs = new Map(
|
|
149
|
+
let outputs = new Map(
|
|
150
|
+
// @ts-expect-error TS2345
|
|
151
|
+
(await queue.run()).map(([asset, code, map]) => [asset, [code, map]]));
|
|
148
152
|
let map = new (_sourceMap().default)(options.projectRoot);
|
|
149
153
|
|
|
150
|
-
//
|
|
154
|
+
// @ts-expect-error TS2339
|
|
151
155
|
if (process.browser) {
|
|
156
|
+
// @ts-expect-error TS2349
|
|
152
157
|
await (0, _lightningcss().default)();
|
|
153
158
|
}
|
|
154
159
|
let res = await (0, _lightningcss().bundleAsync)({
|
|
160
|
+
// @ts-expect-error TS2322
|
|
155
161
|
filename: (0, _nullthrows().default)(entry),
|
|
156
162
|
sourceMap: !!bundle.env.sourceMap,
|
|
157
163
|
resolver: {
|
|
@@ -204,7 +210,13 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
204
210
|
return replaceReferences(bundle, bundleGraph, contents, map, getInlineBundleContents);
|
|
205
211
|
}
|
|
206
212
|
});
|
|
207
|
-
function replaceReferences(
|
|
213
|
+
function replaceReferences(
|
|
214
|
+
// @ts-expect-error TS2304
|
|
215
|
+
bundle,
|
|
216
|
+
// @ts-expect-error TS2304
|
|
217
|
+
bundleGraph, contents,
|
|
218
|
+
// @ts-expect-error TS2552
|
|
219
|
+
map, getInlineBundleContents) {
|
|
208
220
|
({
|
|
209
221
|
contents,
|
|
210
222
|
map
|
|
@@ -236,8 +248,17 @@ function getSpecifier(dep) {
|
|
|
236
248
|
function escapeString(contents) {
|
|
237
249
|
return contents.replace(/(["\\])/g, '\\$1');
|
|
238
250
|
}
|
|
239
|
-
async function processCSSModule(
|
|
251
|
+
async function processCSSModule(
|
|
252
|
+
// @ts-expect-error TS2552
|
|
253
|
+
options,
|
|
254
|
+
// @ts-expect-error TS2304
|
|
255
|
+
logger,
|
|
256
|
+
// @ts-expect-error TS2304
|
|
257
|
+
bundleGraph,
|
|
258
|
+
// @ts-expect-error TS2304
|
|
259
|
+
bundle, asset) {
|
|
240
260
|
var _await$asset$getAST;
|
|
261
|
+
// @ts-expect-error TS2709
|
|
241
262
|
let postcss = await options.packageManager.require('postcss', options.projectRoot + '/index', {
|
|
242
263
|
range: '^8.4.5',
|
|
243
264
|
saveDev: true,
|
|
@@ -252,6 +273,7 @@ async function processCSSModule(options, logger, bundleGraph, bundle, asset) {
|
|
|
252
273
|
let defaultImport = null;
|
|
253
274
|
if (usedSymbols.has('default')) {
|
|
254
275
|
let incoming = bundleGraph.getIncomingDependencies(asset);
|
|
276
|
+
// @ts-expect-error TS7006
|
|
255
277
|
defaultImport = incoming.find(d => d.symbols.hasExportSymbol('default'));
|
|
256
278
|
if (defaultImport) {
|
|
257
279
|
var _defaultImport$symbol;
|
|
@@ -270,7 +292,9 @@ async function processCSSModule(options, logger, bundleGraph, bundle, asset) {
|
|
|
270
292
|
}
|
|
271
293
|
}
|
|
272
294
|
if (!defaultImport && !usedSymbols.has('*')) {
|
|
273
|
-
let usedLocalSymbols = new Set([...usedSymbols].map(exportSymbol =>
|
|
295
|
+
let usedLocalSymbols = new Set([...usedSymbols].map(exportSymbol =>
|
|
296
|
+
// @ts-expect-error TS2731
|
|
297
|
+
`.${(0, _nullthrows().default)(asset.symbols.get(exportSymbol)).local}`));
|
|
274
298
|
ast.walkRules(rule => {
|
|
275
299
|
if (localSymbols.has(rule.selector) && !usedLocalSymbols.has(rule.selector)) {
|
|
276
300
|
rule.remove();
|
|
@@ -302,6 +326,7 @@ async function processCSSModule(options, logger, bundleGraph, bundle, asset) {
|
|
|
302
326
|
function escapeDashedIdent(name) {
|
|
303
327
|
// https://drafts.csswg.org/cssom/#serialize-an-identifier
|
|
304
328
|
let res = '';
|
|
329
|
+
// @ts-expect-error TS2488
|
|
305
330
|
for (let c of name) {
|
|
306
331
|
let code = c.codePointAt(0);
|
|
307
332
|
if (code === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-css",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.141+2f29297bd",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,15 +9,16 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
11
11
|
},
|
|
12
|
-
"main": "lib/CSSPackager.js",
|
|
13
|
-
"source": "src/CSSPackager.
|
|
12
|
+
"main": "./lib/CSSPackager.js",
|
|
13
|
+
"source": "./src/CSSPackager.ts",
|
|
14
|
+
"types": "./lib/CSSPackager.d.ts",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">= 16.0.0"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
19
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
20
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
19
|
+
"@atlaspack/diagnostic": "2.14.1-canary.209+2f29297bd",
|
|
20
|
+
"@atlaspack/plugin": "2.14.5-canary.141+2f29297bd",
|
|
21
|
+
"@atlaspack/utils": "2.14.5-canary.141+2f29297bd",
|
|
21
22
|
"@parcel/source-map": "^2.1.1",
|
|
22
23
|
"lightningcss": "^1.28.2",
|
|
23
24
|
"nullthrows": "^1.1.1"
|
|
@@ -30,5 +31,8 @@
|
|
|
30
31
|
"lightningcss": "lightningcss-wasm"
|
|
31
32
|
},
|
|
32
33
|
"type": "commonjs",
|
|
33
|
-
"
|
|
34
|
-
|
|
34
|
+
"scripts": {
|
|
35
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "2f29297bd550840c9840871559349ef773bcbf6d"
|
|
38
|
+
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import type {Root} from 'postcss';
|
|
4
2
|
import type {Asset, Dependency} from '@atlaspack/types';
|
|
5
|
-
import
|
|
6
|
-
// $FlowFixMe - init for browser build.
|
|
3
|
+
import PostCSS from 'postcss';
|
|
7
4
|
import init, {bundleAsync} from 'lightningcss';
|
|
8
5
|
|
|
9
6
|
import invariant from 'assert';
|
|
@@ -17,7 +14,7 @@ import {
|
|
|
17
14
|
replaceURLReferences,
|
|
18
15
|
} from '@atlaspack/utils';
|
|
19
16
|
|
|
20
|
-
export default
|
|
17
|
+
export default new Packager({
|
|
21
18
|
async package({
|
|
22
19
|
bundle,
|
|
23
20
|
bundleGraph,
|
|
@@ -43,8 +40,10 @@ export default (new Packager({
|
|
|
43
40
|
let queue = new PromiseQueue({
|
|
44
41
|
maxConcurrent: 32,
|
|
45
42
|
});
|
|
46
|
-
|
|
43
|
+
// @ts-expect-error TS2304
|
|
44
|
+
let hoistedImports: Array<DependencySpecifier> = [];
|
|
47
45
|
let assetsByPlaceholder = new Map();
|
|
46
|
+
// @ts-expect-error TS7034
|
|
48
47
|
let entry = null;
|
|
49
48
|
let entryContents = '';
|
|
50
49
|
|
|
@@ -53,6 +52,7 @@ export default (new Packager({
|
|
|
53
52
|
if (node.type === 'asset' && !context) {
|
|
54
53
|
// If there is only one entry, we'll use it directly.
|
|
55
54
|
// Otherwise, we'll create a fake bundle entry with @import rules for each root asset.
|
|
55
|
+
// @ts-expect-error TS7005
|
|
56
56
|
if (entry == null) {
|
|
57
57
|
entry = node.value.id;
|
|
58
58
|
} else {
|
|
@@ -145,23 +145,29 @@ export default (new Packager({
|
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
let outputs = new Map(
|
|
148
|
-
|
|
148
|
+
// @ts-expect-error TS2345
|
|
149
|
+
(await queue.run()).map(([asset, code, map]: [any, any, any]) => [
|
|
150
|
+
asset,
|
|
151
|
+
[code, map],
|
|
152
|
+
]),
|
|
149
153
|
);
|
|
150
154
|
let map = new SourceMap(options.projectRoot);
|
|
151
155
|
|
|
152
|
-
//
|
|
156
|
+
// @ts-expect-error TS2339
|
|
153
157
|
if (process.browser) {
|
|
158
|
+
// @ts-expect-error TS2349
|
|
154
159
|
await init();
|
|
155
160
|
}
|
|
156
161
|
|
|
157
162
|
let res = await bundleAsync({
|
|
163
|
+
// @ts-expect-error TS2322
|
|
158
164
|
filename: nullthrows(entry),
|
|
159
165
|
sourceMap: !!bundle.env.sourceMap,
|
|
160
166
|
resolver: {
|
|
161
|
-
resolve(specifier) {
|
|
167
|
+
resolve(specifier: string) {
|
|
162
168
|
return specifier;
|
|
163
169
|
},
|
|
164
|
-
async read(file) {
|
|
170
|
+
async read(file: string) {
|
|
165
171
|
if (file === bundle.id) {
|
|
166
172
|
return entryContents;
|
|
167
173
|
}
|
|
@@ -216,14 +222,25 @@ export default (new Packager({
|
|
|
216
222
|
getInlineBundleContents,
|
|
217
223
|
);
|
|
218
224
|
},
|
|
219
|
-
})
|
|
225
|
+
}) as Packager<unknown, unknown>;
|
|
220
226
|
|
|
221
227
|
function replaceReferences(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
// @ts-expect-error TS2304
|
|
229
|
+
bundle: NamedBundle,
|
|
230
|
+
// @ts-expect-error TS2304
|
|
231
|
+
bundleGraph: BundleGraph<NamedBundle>,
|
|
232
|
+
contents: string,
|
|
233
|
+
// @ts-expect-error TS2552
|
|
234
|
+
map: NodeSourceMap | null | undefined,
|
|
235
|
+
getInlineBundleContents: (
|
|
236
|
+
// @ts-expect-error TS2304
|
|
237
|
+
arg1: Bundle,
|
|
238
|
+
// @ts-expect-error TS2304
|
|
239
|
+
arg2: BundleGraph<NamedBundle>,
|
|
240
|
+
// @ts-expect-error TS2304
|
|
241
|
+
) => Async<{
|
|
242
|
+
contents: Blob;
|
|
243
|
+
}>,
|
|
227
244
|
) {
|
|
228
245
|
({contents, map} = replaceURLReferences({
|
|
229
246
|
bundle,
|
|
@@ -259,12 +276,17 @@ function escapeString(contents: string): string {
|
|
|
259
276
|
}
|
|
260
277
|
|
|
261
278
|
async function processCSSModule(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
279
|
+
// @ts-expect-error TS2552
|
|
280
|
+
options: PluginOptions,
|
|
281
|
+
// @ts-expect-error TS2304
|
|
282
|
+
logger: PluginLogger,
|
|
283
|
+
// @ts-expect-error TS2304
|
|
284
|
+
bundleGraph: BundleGraph<NamedBundle>,
|
|
285
|
+
// @ts-expect-error TS2304
|
|
286
|
+
bundle: NamedBundle,
|
|
287
|
+
asset: Asset,
|
|
288
|
+
): Promise<[Asset, string, SourceMap | null | undefined]> {
|
|
289
|
+
// @ts-expect-error TS2709
|
|
268
290
|
let postcss: PostCSS = await options.packageManager.require(
|
|
269
291
|
'postcss',
|
|
270
292
|
options.projectRoot + '/index',
|
|
@@ -280,12 +302,13 @@ async function processCSSModule(
|
|
|
280
302
|
let usedSymbols = bundleGraph.getUsedSymbols(asset);
|
|
281
303
|
if (usedSymbols != null) {
|
|
282
304
|
let localSymbols = new Set(
|
|
283
|
-
[...asset.symbols].map(([, {local}]) => `.${local}`),
|
|
305
|
+
[...asset.symbols].map(([, {local}]: [any, any]) => `.${local}`),
|
|
284
306
|
);
|
|
285
307
|
|
|
286
308
|
let defaultImport = null;
|
|
287
309
|
if (usedSymbols.has('default')) {
|
|
288
310
|
let incoming = bundleGraph.getIncomingDependencies(asset);
|
|
311
|
+
// @ts-expect-error TS7006
|
|
289
312
|
defaultImport = incoming.find((d) =>
|
|
290
313
|
d.symbols.hasExportSymbol('default'),
|
|
291
314
|
);
|
|
@@ -314,6 +337,7 @@ async function processCSSModule(
|
|
|
314
337
|
let usedLocalSymbols = new Set(
|
|
315
338
|
[...usedSymbols].map(
|
|
316
339
|
(exportSymbol) =>
|
|
340
|
+
// @ts-expect-error TS2731
|
|
317
341
|
`.${nullthrows(asset.symbols.get(exportSymbol)).local}`,
|
|
318
342
|
),
|
|
319
343
|
);
|
|
@@ -349,9 +373,10 @@ async function processCSSModule(
|
|
|
349
373
|
return [asset, content, sourceMap];
|
|
350
374
|
}
|
|
351
375
|
|
|
352
|
-
function escapeDashedIdent(name) {
|
|
376
|
+
function escapeDashedIdent(name: symbol | string) {
|
|
353
377
|
// https://drafts.csswg.org/cssom/#serialize-an-identifier
|
|
354
378
|
let res = '';
|
|
379
|
+
// @ts-expect-error TS2488
|
|
355
380
|
for (let c of name) {
|
|
356
381
|
let code = c.codePointAt(0);
|
|
357
382
|
if (code === 0) {
|
package/tsconfig.json
ADDED