@atlaspack/optimizer-css 2.14.5-canary.17 → 2.14.5-canary.171
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 +176 -0
- package/lib/CSSOptimizer.js +12 -3
- package/lib/types/CSSOptimizer.d.ts +3 -0
- package/package.json +12 -7
- package/src/{CSSOptimizer.js → CSSOptimizer.ts} +12 -7
- package/tsconfig.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,181 @@
|
|
|
1
1
|
# @atlaspack/optimizer-css
|
|
2
2
|
|
|
3
|
+
## 2.14.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @atlaspack/utils@2.18.4
|
|
9
|
+
- @atlaspack/plugin@2.14.27
|
|
10
|
+
|
|
11
|
+
## 2.14.26
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
|
|
18
|
+
- @atlaspack/diagnostic@2.14.3
|
|
19
|
+
- @atlaspack/plugin@2.14.26
|
|
20
|
+
- @atlaspack/utils@2.18.3
|
|
21
|
+
|
|
22
|
+
## 2.14.25
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies []:
|
|
27
|
+
- @atlaspack/utils@2.18.2
|
|
28
|
+
- @atlaspack/plugin@2.14.25
|
|
29
|
+
|
|
30
|
+
## 2.14.24
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies []:
|
|
35
|
+
- @atlaspack/utils@2.18.1
|
|
36
|
+
- @atlaspack/plugin@2.14.24
|
|
37
|
+
|
|
38
|
+
## 2.14.23
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
|
|
43
|
+
- @atlaspack/utils@2.18.0
|
|
44
|
+
- @atlaspack/plugin@2.14.23
|
|
45
|
+
|
|
46
|
+
## 2.14.22
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
|
|
53
|
+
- @atlaspack/diagnostic@2.14.2
|
|
54
|
+
- @atlaspack/plugin@2.14.22
|
|
55
|
+
- @atlaspack/utils@2.17.4
|
|
56
|
+
|
|
57
|
+
## 2.14.21
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies []:
|
|
62
|
+
- @atlaspack/utils@2.17.3
|
|
63
|
+
- @atlaspack/plugin@2.14.21
|
|
64
|
+
|
|
65
|
+
## 2.14.20
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- [#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
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
|
|
72
|
+
- @atlaspack/plugin@2.14.20
|
|
73
|
+
- @atlaspack/utils@2.17.2
|
|
74
|
+
|
|
75
|
+
## 2.14.19
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- Updated dependencies []:
|
|
80
|
+
- @atlaspack/utils@2.17.1
|
|
81
|
+
- @atlaspack/plugin@2.14.19
|
|
82
|
+
|
|
83
|
+
## 2.14.18
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- 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)]:
|
|
88
|
+
- @atlaspack/utils@2.17.0
|
|
89
|
+
- @atlaspack/plugin@2.14.18
|
|
90
|
+
|
|
91
|
+
## 2.14.17
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- Updated dependencies []:
|
|
96
|
+
- @atlaspack/utils@2.16.1
|
|
97
|
+
- @atlaspack/plugin@2.14.17
|
|
98
|
+
|
|
99
|
+
## 2.14.16
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
|
|
104
|
+
- @atlaspack/utils@2.16.0
|
|
105
|
+
- @atlaspack/plugin@2.14.16
|
|
106
|
+
|
|
107
|
+
## 2.14.15
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- Updated dependencies []:
|
|
112
|
+
- @atlaspack/utils@2.15.3
|
|
113
|
+
- @atlaspack/plugin@2.14.15
|
|
114
|
+
|
|
115
|
+
## 2.14.14
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- Updated dependencies []:
|
|
120
|
+
- @atlaspack/utils@2.15.2
|
|
121
|
+
- @atlaspack/plugin@2.14.14
|
|
122
|
+
|
|
123
|
+
## 2.14.13
|
|
124
|
+
|
|
125
|
+
### Patch Changes
|
|
126
|
+
|
|
127
|
+
- Updated dependencies []:
|
|
128
|
+
- @atlaspack/utils@2.15.1
|
|
129
|
+
- @atlaspack/plugin@2.14.13
|
|
130
|
+
|
|
131
|
+
## 2.14.12
|
|
132
|
+
|
|
133
|
+
### Patch Changes
|
|
134
|
+
|
|
135
|
+
- Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
|
|
136
|
+
- @atlaspack/utils@2.15.0
|
|
137
|
+
- @atlaspack/plugin@2.14.12
|
|
138
|
+
|
|
139
|
+
## 2.14.11
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies []:
|
|
144
|
+
- @atlaspack/utils@2.14.11
|
|
145
|
+
- @atlaspack/plugin@2.14.11
|
|
146
|
+
|
|
147
|
+
## 2.14.10
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies []:
|
|
152
|
+
- @atlaspack/plugin@2.14.10
|
|
153
|
+
- @atlaspack/utils@2.14.10
|
|
154
|
+
|
|
155
|
+
## 2.14.9
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies []:
|
|
160
|
+
- @atlaspack/utils@2.14.9
|
|
161
|
+
- @atlaspack/plugin@2.14.9
|
|
162
|
+
|
|
163
|
+
## 2.14.8
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- Updated dependencies []:
|
|
168
|
+
- @atlaspack/utils@2.14.8
|
|
169
|
+
- @atlaspack/plugin@2.14.8
|
|
170
|
+
|
|
171
|
+
## 2.14.7
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- Updated dependencies []:
|
|
176
|
+
- @atlaspack/utils@2.14.7
|
|
177
|
+
- @atlaspack/plugin@2.14.7
|
|
178
|
+
|
|
3
179
|
## 2.14.6
|
|
4
180
|
|
|
5
181
|
### Patch Changes
|
package/lib/CSSOptimizer.js
CHANGED
|
@@ -63,7 +63,6 @@ function _diagnostic() {
|
|
|
63
63
|
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); }
|
|
64
64
|
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; }
|
|
65
65
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
66
|
-
// $FlowFixMe - init for browser build.
|
|
67
66
|
var _default = exports.default = new (_plugin().Optimizer)({
|
|
68
67
|
async loadConfig({
|
|
69
68
|
config,
|
|
@@ -138,11 +137,15 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
138
137
|
return;
|
|
139
138
|
}
|
|
140
139
|
let defaultImport = null;
|
|
140
|
+
// @ts-expect-error TS2345
|
|
141
141
|
if (usedSymbols.has('default')) {
|
|
142
142
|
let incoming = bundleGraph.getIncomingDependencies(asset);
|
|
143
|
-
defaultImport = incoming.find(d =>
|
|
143
|
+
defaultImport = incoming.find(d =>
|
|
144
|
+
// @ts-expect-error TS2345
|
|
145
|
+
d.symbols.hasExportSymbol('default'));
|
|
144
146
|
if (defaultImport) {
|
|
145
147
|
var _defaultImport$symbol;
|
|
148
|
+
// @ts-expect-error TS2345
|
|
146
149
|
let loc = (_defaultImport$symbol = defaultImport.symbols.get('default')) === null || _defaultImport$symbol === void 0 ? void 0 : _defaultImport$symbol.loc;
|
|
147
150
|
logger.warn({
|
|
148
151
|
message: 'CSS modules cannot be tree shaken when imported with a default specifier',
|
|
@@ -157,10 +160,13 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
157
160
|
});
|
|
158
161
|
}
|
|
159
162
|
}
|
|
163
|
+
|
|
164
|
+
// @ts-expect-error TS2345
|
|
160
165
|
if (!defaultImport && !usedSymbols.has('*')) {
|
|
161
166
|
for (let [symbol, {
|
|
162
167
|
local
|
|
163
168
|
}] of asset.symbols) {
|
|
169
|
+
// @ts-expect-error TS2367
|
|
164
170
|
if (local !== 'default' && !usedSymbols.has(symbol)) {
|
|
165
171
|
unusedSymbols.push(local);
|
|
166
172
|
}
|
|
@@ -184,8 +190,9 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
184
190
|
}
|
|
185
191
|
}
|
|
186
192
|
|
|
187
|
-
//
|
|
193
|
+
// @ts-expect-error TS2339
|
|
188
194
|
if (process.browser) {
|
|
195
|
+
// @ts-expect-error TS2349
|
|
189
196
|
await (0, _lightningcss().default)();
|
|
190
197
|
}
|
|
191
198
|
let result = (0, _lightningcss().transform)({
|
|
@@ -202,6 +209,7 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
202
209
|
map = new (_sourceMap().default)(options.projectRoot);
|
|
203
210
|
map.addVLQMap(vlqMap);
|
|
204
211
|
if (prevMap) {
|
|
212
|
+
// @ts-expect-error TS2345
|
|
205
213
|
map.extends(prevMap);
|
|
206
214
|
}
|
|
207
215
|
}
|
|
@@ -209,6 +217,7 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
209
217
|
if (bundle.env.sourceMap) {
|
|
210
218
|
let reference = await getSourceMapReference(map);
|
|
211
219
|
if (reference != null) {
|
|
220
|
+
// @ts-expect-error TS2322
|
|
212
221
|
contents = contents.toString() + '\n' + '/*# sourceMappingURL=' + reference + ' */\n';
|
|
213
222
|
}
|
|
214
223
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/optimizer-css",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.171+f0349a6b9",
|
|
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/CSSOptimizer.js",
|
|
13
|
-
"source": "src/CSSOptimizer.
|
|
12
|
+
"main": "./lib/CSSOptimizer.js",
|
|
13
|
+
"source": "./src/CSSOptimizer.ts",
|
|
14
|
+
"types": "./lib/types/CSSOptimizer.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.239+f0349a6b9",
|
|
20
|
+
"@atlaspack/plugin": "2.14.5-canary.171+f0349a6b9",
|
|
21
|
+
"@atlaspack/utils": "2.14.5-canary.171+f0349a6b9",
|
|
21
22
|
"@parcel/source-map": "^2.1.1",
|
|
22
23
|
"browserslist": "^4.6.6",
|
|
23
24
|
"lightningcss": "^1.28.2",
|
|
@@ -30,5 +31,9 @@
|
|
|
30
31
|
"lightningcss": "lightningcss-wasm"
|
|
31
32
|
},
|
|
32
33
|
"type": "commonjs",
|
|
33
|
-
"
|
|
34
|
+
"scripts": {
|
|
35
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src",
|
|
36
|
+
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
37
|
+
},
|
|
38
|
+
"gitHead": "f0349a6b9b04755088f121095ca6301a2ada3767"
|
|
34
39
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// @flow strict-local
|
|
2
|
-
|
|
3
1
|
import SourceMap from '@parcel/source-map';
|
|
4
2
|
import {Optimizer} from '@atlaspack/plugin';
|
|
5
|
-
// $FlowFixMe - init for browser build.
|
|
6
3
|
import init, {
|
|
7
4
|
transform,
|
|
8
5
|
transformStyleAttribute,
|
|
@@ -18,7 +15,7 @@ import {
|
|
|
18
15
|
generateJSONCodeHighlights,
|
|
19
16
|
} from '@atlaspack/diagnostic';
|
|
20
17
|
|
|
21
|
-
export default
|
|
18
|
+
export default new Optimizer({
|
|
22
19
|
async loadConfig({config, logger, options}) {
|
|
23
20
|
const configFile = await config.getConfig(
|
|
24
21
|
[
|
|
@@ -101,12 +98,15 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
101
98
|
}
|
|
102
99
|
|
|
103
100
|
let defaultImport = null;
|
|
101
|
+
// @ts-expect-error TS2345
|
|
104
102
|
if (usedSymbols.has('default')) {
|
|
105
103
|
let incoming = bundleGraph.getIncomingDependencies(asset);
|
|
106
104
|
defaultImport = incoming.find((d) =>
|
|
105
|
+
// @ts-expect-error TS2345
|
|
107
106
|
d.symbols.hasExportSymbol('default'),
|
|
108
107
|
);
|
|
109
108
|
if (defaultImport) {
|
|
109
|
+
// @ts-expect-error TS2345
|
|
110
110
|
let loc = defaultImport.symbols.get('default')?.loc;
|
|
111
111
|
logger.warn({
|
|
112
112
|
message:
|
|
@@ -130,8 +130,10 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
// @ts-expect-error TS2345
|
|
133
134
|
if (!defaultImport && !usedSymbols.has('*')) {
|
|
134
135
|
for (let [symbol, {local}] of asset.symbols) {
|
|
136
|
+
// @ts-expect-error TS2367
|
|
135
137
|
if (local !== 'default' && !usedSymbols.has(symbol)) {
|
|
136
138
|
unusedSymbols.push(local);
|
|
137
139
|
}
|
|
@@ -156,8 +158,9 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
//
|
|
161
|
+
// @ts-expect-error TS2339
|
|
160
162
|
if (process.browser) {
|
|
163
|
+
// @ts-expect-error TS2349
|
|
161
164
|
await init();
|
|
162
165
|
}
|
|
163
166
|
|
|
@@ -176,6 +179,7 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
176
179
|
map = new SourceMap(options.projectRoot);
|
|
177
180
|
map.addVLQMap(vlqMap);
|
|
178
181
|
if (prevMap) {
|
|
182
|
+
// @ts-expect-error TS2345
|
|
179
183
|
map.extends(prevMap);
|
|
180
184
|
}
|
|
181
185
|
}
|
|
@@ -184,6 +188,7 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
184
188
|
if (bundle.env.sourceMap) {
|
|
185
189
|
let reference = await getSourceMapReference(map);
|
|
186
190
|
if (reference != null) {
|
|
191
|
+
// @ts-expect-error TS2322
|
|
187
192
|
contents =
|
|
188
193
|
contents.toString() +
|
|
189
194
|
'\n' +
|
|
@@ -198,11 +203,11 @@ Atlaspack\'s default CSS minifer changed from cssnano to lightningcss, but a "cs
|
|
|
198
203
|
map,
|
|
199
204
|
};
|
|
200
205
|
},
|
|
201
|
-
})
|
|
206
|
+
}) as Optimizer<unknown, unknown>;
|
|
202
207
|
|
|
203
208
|
let cache = new Map();
|
|
204
209
|
|
|
205
|
-
function getTargets(browsers) {
|
|
210
|
+
function getTargets(browsers: undefined | string | Array<string>) {
|
|
206
211
|
if (browsers == null) {
|
|
207
212
|
return undefined;
|
|
208
213
|
}
|
package/tsconfig.json
ADDED