@compiled/webpack-loader 0.7.5 → 0.7.6
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/dist/__fixtures__/binding-not-found.d.ts +1 -1
- package/dist/__fixtures__/binding-not-found.js +2 -2
- package/dist/__fixtures__/binding-not-found.js.map +1 -1
- package/dist/__fixtures__/common/css-prop.js +1 -1
- package/dist/__fixtures__/common/css-prop.js.map +1 -1
- package/dist/__fixtures__/compiled-error.js +2 -2
- package/dist/__fixtures__/compiled-error.js.map +1 -1
- package/dist/__fixtures__/important-styles.js +1 -1
- package/dist/__fixtures__/important-styles.js.map +1 -1
- package/dist/__fixtures__/lib/loader-alias.js +1 -1
- package/dist/__fixtures__/lib/loader-alias.js.map +1 -1
- package/dist/__fixtures__/lib/webpack-alias.js +1 -1
- package/dist/__fixtures__/lib/webpack-alias.js.map +1 -1
- package/dist/__fixtures__/loader-alias.js +1 -1
- package/dist/__fixtures__/loader-alias.js.map +1 -1
- package/dist/__fixtures__/local-styles.js +3 -3
- package/dist/__fixtures__/local-styles.js.map +1 -1
- package/dist/__fixtures__/relative-styles.d.ts +1 -1
- package/dist/__fixtures__/relative-styles.js +4 -4
- package/dist/__fixtures__/relative-styles.js.map +1 -1
- package/dist/__fixtures__/webpack-alias.js +1 -1
- package/dist/__fixtures__/webpack-alias.js.map +1 -1
- package/dist/compiled-loader.js +13 -9
- package/dist/compiled-loader.js.map +1 -1
- package/dist/extract-plugin.js +20 -22
- package/dist/extract-plugin.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/package.json +12 -8
- package/src/compiled-loader.tsx +5 -0
- package/src/types.tsx +5 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const HeaderSpacing: React.ComponentType<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & import("
|
|
2
|
+
export declare const HeaderSpacing: React.ComponentType<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & import("packages/react/src/styled").StyledProps>;
|
|
3
3
|
interface HeaderProps {
|
|
4
4
|
variant?: 'default' | 'invert';
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -37,8 +37,8 @@ exports.HeaderSpacing = react_1.styled.div `
|
|
|
37
37
|
const Header = (_a) => {
|
|
38
38
|
var { children, variant = 'default' } = _a, props = __rest(_a, ["children", "variant"]);
|
|
39
39
|
const color = variant === 'default' ? 'rgba(37, 56, 88, 0.9)' : 'rgba(255, 255, 255, 0.75)';
|
|
40
|
-
return (react_1.jsx(StyledHeader, Object.assign({ variant: variant, color: color }, props),
|
|
41
|
-
react_1.jsx("a", { href: "/", css: { textDecoration: 'none', color: 'currentColor' } }, "Compiled"),
|
|
40
|
+
return ((0, react_1.jsx)(StyledHeader, Object.assign({ variant: variant, color: color }, props),
|
|
41
|
+
(0, react_1.jsx)("a", { href: "/", css: { textDecoration: 'none', color: 'currentColor' } }, "Compiled"),
|
|
42
42
|
children));
|
|
43
43
|
};
|
|
44
44
|
exports.Header = Header;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-not-found.js","sourceRoot":"","sources":["../../src/__fixtures__/binding-not-found.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,eAAe;AACf,2CAA8C;AAG9C,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,YAAY,GAAG,cAAM,CAAC,MAAM,CAGhC;YACU,MAAM;;;;;;;;;;;;MAYZ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,aAAa,CAAC;WAChF,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;CAChC,CAAC;AAEW,QAAA,aAAa,GAAG,cAAM,CAAC,GAAG,CAAA;YAC3B,MAAM;CACjB,CAAC;AAOK,MAAM,MAAM,GAAG,CAAC,EAAw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A,MAAM,UAWjB"}
|
|
@@ -4,6 +4,6 @@ exports.Coral = void 0;
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
const react_1 = require("@compiled/react");
|
|
6
6
|
const colors_1 = require("./colors");
|
|
7
|
-
const Coral = () => (react_1.jsx("div", { css: { color: colors_1.coral, border: `2px solid ${colors_1.coral}` } }));
|
|
7
|
+
const Coral = () => ((0, react_1.jsx)("div", { css: { color: colors_1.coral, border: `2px solid ${colors_1.coral}` } }));
|
|
8
8
|
exports.Coral = Coral;
|
|
9
9
|
//# sourceMappingURL=css-prop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-prop.js","sourceRoot":"","sources":["../../../src/__fixtures__/common/css-prop.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAAsC;AAEtC,qCAAiC;AAE1B,MAAM,KAAK,GAAG,GAAgB,EAAE,CAAC,CACtC,
|
|
1
|
+
{"version":3,"file":"css-prop.js","sourceRoot":"","sources":["../../../src/__fixtures__/common/css-prop.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAAsC;AAEtC,qCAAiC;AAE1B,MAAM,KAAK,GAAG,GAAgB,EAAE,CAAC,CACtC,0BAAK,GAAG,EAAE,EAAE,KAAK,EAAE,cAAK,EAAE,MAAM,EAAE,aAAa,cAAK,EAAE,EAAE,GAAI,CAC7D,CAAC;AAFW,QAAA,KAAK,SAEhB"}
|
|
@@ -4,7 +4,7 @@ exports.App = void 0;
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
const react_1 = require("@compiled/react");
|
|
6
6
|
// @ts-expect-error
|
|
7
|
-
const styles = react_1.css(false);
|
|
8
|
-
const App = () => react_1.jsx("div", { css: styles });
|
|
7
|
+
const styles = (0, react_1.css)(false);
|
|
8
|
+
const App = () => (0, react_1.jsx)("div", { css: styles });
|
|
9
9
|
exports.App = App;
|
|
10
10
|
//# sourceMappingURL=compiled-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiled-error.js","sourceRoot":"","sources":["../../src/__fixtures__/compiled-error.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAA2C;AAE3C,mBAAmB;AACnB,MAAM,MAAM,GAAG,WAAG,
|
|
1
|
+
{"version":3,"file":"compiled-error.js","sourceRoot":"","sources":["../../src/__fixtures__/compiled-error.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAA2C;AAE3C,mBAAmB;AACnB,MAAM,MAAM,GAAG,IAAA,WAAG,EAAC,KAAK,CAAC,CAAC;AAEnB,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,0BAAK,GAAG,EAAE,MAAM,GAAI,CAAC;AAA9C,QAAA,GAAG,OAA2C"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
const react_1 = require("@compiled/react");
|
|
5
|
-
const Component = () => react_1.jsx("div", { css: { fontSize: '12!important', color: 'blue' } });
|
|
5
|
+
const Component = () => (0, react_1.jsx)("div", { css: { fontSize: '12!important', color: 'blue' } });
|
|
6
6
|
exports.default = Component;
|
|
7
7
|
//# sourceMappingURL=important-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"important-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/important-styles.tsx"],"names":[],"mappings":";;AAAA,eAAe;AACf,2CAAsC;AAEtC,MAAM,SAAS,GAAG,GAAgB,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"important-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/important-styles.tsx"],"names":[],"mappings":";;AAAA,eAAe;AACf,2CAAsC;AAEtC,MAAM,SAAS,GAAG,GAAgB,EAAE,CAAC,0BAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,GAAI,CAAC;AAE/F,kBAAe,SAAS,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.styles = void 0;
|
|
4
4
|
const react_1 = require("@compiled/react");
|
|
5
|
-
exports.styles = react_1.css({
|
|
5
|
+
exports.styles = (0, react_1.css)({
|
|
6
6
|
color: 'indigo',
|
|
7
7
|
});
|
|
8
8
|
//# sourceMappingURL=loader-alias.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-alias.js","sourceRoot":"","sources":["../../../src/__fixtures__/lib/loader-alias.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEzB,QAAA,MAAM,GAAG,WAAG,
|
|
1
|
+
{"version":3,"file":"loader-alias.js","sourceRoot":"","sources":["../../../src/__fixtures__/lib/loader-alias.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEzB,QAAA,MAAM,GAAG,IAAA,WAAG,EAAC;IACxB,KAAK,EAAE,QAAQ;CAChB,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.styles = void 0;
|
|
4
4
|
const react_1 = require("@compiled/react");
|
|
5
|
-
exports.styles = react_1.css({
|
|
5
|
+
exports.styles = (0, react_1.css)({
|
|
6
6
|
color: 'blue',
|
|
7
7
|
});
|
|
8
8
|
//# sourceMappingURL=webpack-alias.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-alias.js","sourceRoot":"","sources":["../../../src/__fixtures__/lib/webpack-alias.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEzB,QAAA,MAAM,GAAG,WAAG,
|
|
1
|
+
{"version":3,"file":"webpack-alias.js","sourceRoot":"","sources":["../../../src/__fixtures__/lib/webpack-alias.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEzB,QAAA,MAAM,GAAG,IAAA,WAAG,EAAC;IACxB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC"}
|
|
@@ -7,6 +7,6 @@ exports.App = void 0;
|
|
|
7
7
|
const react_1 = require("@compiled/react");
|
|
8
8
|
// @ts-expect-error
|
|
9
9
|
const loader_alias_1 = require("loader-alias");
|
|
10
|
-
const App = () => react_1.jsx("div", { css: loader_alias_1.styles });
|
|
10
|
+
const App = () => (0, react_1.jsx)("div", { css: loader_alias_1.styles });
|
|
11
11
|
exports.App = App;
|
|
12
12
|
//# sourceMappingURL=loader-alias.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-alias.js","sourceRoot":"","sources":["../../src/__fixtures__/loader-alias.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,iFAAiF;AACjF,6DAA6D;AAC7D,2CAA2C;AAC3C,mBAAmB;AACnB,+CAAsC;AAE/B,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"loader-alias.js","sourceRoot":"","sources":["../../src/__fixtures__/loader-alias.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,iFAAiF;AACjF,6DAA6D;AAC7D,2CAA2C;AAC3C,mBAAmB;AACnB,+CAAsC;AAE/B,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,0BAAK,GAAG,EAAE,qBAAM,GAAI,CAAC;AAA9C,QAAA,GAAG,OAA2C"}
|
|
@@ -7,8 +7,8 @@ const react_2 = require("react");
|
|
|
7
7
|
const Styled = react_1.styled.div({
|
|
8
8
|
color: 'blue',
|
|
9
9
|
});
|
|
10
|
-
const App = () => (react_1.jsx(react_2.Fragment, null,
|
|
11
|
-
react_1.jsx("div", { css: { fontSize: 14 } }),
|
|
12
|
-
react_1.jsx(Styled, null)));
|
|
10
|
+
const App = () => ((0, react_1.jsx)(react_2.Fragment, null,
|
|
11
|
+
(0, react_1.jsx)("div", { css: { fontSize: 14 } }),
|
|
12
|
+
(0, react_1.jsx)(Styled, null)));
|
|
13
13
|
exports.App = App;
|
|
14
14
|
//# sourceMappingURL=local-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/local-styles.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAA8C;AAC9C,iCAAiC;AAEjC,MAAM,MAAM,GAAG,cAAM,CAAC,GAAG,CAAC;IACxB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEI,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,CACpC,
|
|
1
|
+
{"version":3,"file":"local-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/local-styles.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAA8C;AAC9C,iCAAiC;AAEjC,MAAM,MAAM,GAAG,cAAM,CAAC,GAAG,CAAC;IACxB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEI,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,CACpC,iBAAC,gBAAQ;IACP,0BAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAI;IAC9B,iBAAC,MAAM,OAAG,CACD,CACZ,CAAC;AALW,QAAA,GAAG,OAKd"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const Styled: import("react").ComponentType<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & import("
|
|
2
|
+
export declare const Styled: import("react").ComponentType<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & import("packages/react/src/styled").StyledProps>;
|
|
3
3
|
export declare const App: () => JSX.Element;
|
|
@@ -16,7 +16,7 @@ exports.Styled = react_1.styled.span `
|
|
|
16
16
|
color: ${colors_1.blue};
|
|
17
17
|
}
|
|
18
18
|
`;
|
|
19
|
-
const styles = react_1.css `
|
|
19
|
+
const styles = (0, react_1.css) `
|
|
20
20
|
color: ${colors_1.red};
|
|
21
21
|
|
|
22
22
|
:focus {
|
|
@@ -27,8 +27,8 @@ const styles = react_1.css `
|
|
|
27
27
|
color: ${colors_1.yellow};
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
|
-
const App = () => (react_1.jsx(react_2.Fragment, null,
|
|
31
|
-
react_1.jsx("div", { css: styles }),
|
|
32
|
-
react_1.jsx(exports.Styled, null)));
|
|
30
|
+
const App = () => ((0, react_1.jsx)(react_2.Fragment, null,
|
|
31
|
+
(0, react_1.jsx)("div", { css: styles }),
|
|
32
|
+
(0, react_1.jsx)(exports.Styled, null)));
|
|
33
33
|
exports.App = App;
|
|
34
34
|
//# sourceMappingURL=relative-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/relative-styles.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAAmD;AACnD,iCAAiC;AAEjC,4CAAgF;AAKnE,QAAA,MAAM,GAAG,cAAM,CAAC,IAAI,CAAA;WACtB,mBAAU;;;aAGR,eAAM;;;;aAIN,aAAI;;CAEhB,CAAC;AAEF,MAAM,MAAM,GAAG,WAAG,
|
|
1
|
+
{"version":3,"file":"relative-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/relative-styles.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,2CAAmD;AACnD,iCAAiC;AAEjC,4CAAgF;AAKnE,QAAA,MAAM,GAAG,cAAM,CAAC,IAAI,CAAA;WACtB,mBAAU;;;aAGR,eAAM;;;;aAIN,aAAI;;CAEhB,CAAC;AAEF,MAAM,MAAM,GAAG,IAAA,WAAG,EAAA;WACP,YAAG;;;aAGD,eAAM;;;;aAIN,eAAM;;CAElB,CAAC;AAEK,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,CACpC,iBAAC,gBAAQ;IACP,0BAAK,GAAG,EAAE,MAAM,GAAI;IACpB,iBAAC,cAAM,OAAG,CACD,CACZ,CAAC;AALW,QAAA,GAAG,OAKd"}
|
|
@@ -7,6 +7,6 @@ exports.App = void 0;
|
|
|
7
7
|
const react_1 = require("@compiled/react");
|
|
8
8
|
// @ts-expect-error
|
|
9
9
|
const webpack_alias_1 = require("webpack-alias");
|
|
10
|
-
const App = () => react_1.jsx("div", { css: webpack_alias_1.styles });
|
|
10
|
+
const App = () => (0, react_1.jsx)("div", { css: webpack_alias_1.styles });
|
|
11
11
|
exports.App = App;
|
|
12
12
|
//# sourceMappingURL=webpack-alias.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-alias.js","sourceRoot":"","sources":["../../src/__fixtures__/webpack-alias.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,uFAAuF;AACvF,6DAA6D;AAC7D,2CAA2C;AAC3C,mBAAmB;AACnB,iDAAuC;AAEhC,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"webpack-alias.js","sourceRoot":"","sources":["../../src/__fixtures__/webpack-alias.tsx"],"names":[],"mappings":";;;AAAA,eAAe;AACf,uFAAuF;AACvF,6DAA6D;AAC7D,2CAA2C;AAC3C,mBAAmB;AACnB,iDAAuC;AAEhC,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,0BAAK,GAAG,EAAE,sBAAM,GAAI,CAAC;AAA9C,QAAA,GAAG,OAA2C"}
|
package/dist/compiled-loader.js
CHANGED
|
@@ -31,9 +31,9 @@ let hasErrored = false;
|
|
|
31
31
|
* @returns
|
|
32
32
|
*/
|
|
33
33
|
function getLoaderOptions(context) {
|
|
34
|
-
const { bake = true, extract = false, importReact = undefined, nonce = undefined, resolve = {}, } = typeof context.getOptions === 'undefined'
|
|
34
|
+
const { bake = true, extract = false, importReact = undefined, nonce = undefined, resolve = {}, extensions = undefined, } = typeof context.getOptions === 'undefined'
|
|
35
35
|
? // Webpack v4 flow
|
|
36
|
-
loader_utils_1.getOptions(context)
|
|
36
|
+
(0, loader_utils_1.getOptions)(context)
|
|
37
37
|
: // Webpack v5 flow
|
|
38
38
|
context.getOptions({
|
|
39
39
|
type: 'object',
|
|
@@ -53,6 +53,9 @@ function getLoaderOptions(context) {
|
|
|
53
53
|
resolve: {
|
|
54
54
|
type: 'object',
|
|
55
55
|
},
|
|
56
|
+
extensions: {
|
|
57
|
+
type: 'array',
|
|
58
|
+
},
|
|
56
59
|
},
|
|
57
60
|
});
|
|
58
61
|
return {
|
|
@@ -61,6 +64,7 @@ function getLoaderOptions(context) {
|
|
|
61
64
|
importReact,
|
|
62
65
|
nonce,
|
|
63
66
|
resolve,
|
|
67
|
+
extensions,
|
|
64
68
|
};
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
@@ -81,7 +85,7 @@ async function compiledLoader(code) {
|
|
|
81
85
|
const foundCSSRules = [];
|
|
82
86
|
const _d = getLoaderOptions(this), { resolve } = _d, options = __rest(_d, ["resolve"]);
|
|
83
87
|
// Transform to an AST using the local babel config.
|
|
84
|
-
const ast = await core_1.parseAsync(code, {
|
|
88
|
+
const ast = await (0, core_1.parseAsync)(code, {
|
|
85
89
|
filename: this.resourcePath,
|
|
86
90
|
caller: { name: 'compiled' },
|
|
87
91
|
rootMode: 'upward-optional',
|
|
@@ -95,7 +99,7 @@ async function compiledLoader(code) {
|
|
|
95
99
|
// This makes the resolver invoke the callback synchronously
|
|
96
100
|
useSyncFileSystemCalls: true }));
|
|
97
101
|
// Transform using the Compiled Babel Plugin - we deliberately turn off using the local config.
|
|
98
|
-
const result = await core_1.transformFromAstAsync(ast, code, {
|
|
102
|
+
const result = await (0, core_1.transformFromAstAsync)(ast, code, {
|
|
99
103
|
babelrc: false,
|
|
100
104
|
configFile: false,
|
|
101
105
|
sourceMaps: true,
|
|
@@ -110,14 +114,14 @@ async function compiledLoader(code) {
|
|
|
110
114
|
Object.assign(Object.assign({}, options), { onIncludedFiles: (files) => includedFiles.push(...files), resolver: {
|
|
111
115
|
// The resolver needs to be synchronous, as babel plugins must be synchronous
|
|
112
116
|
resolveSync: (context, request) => {
|
|
113
|
-
return resolver.resolveSync({}, path_1.dirname(context), request);
|
|
117
|
+
return resolver.resolveSync({}, (0, path_1.dirname)(context), request);
|
|
114
118
|
},
|
|
115
119
|
} }),
|
|
116
120
|
],
|
|
117
121
|
].filter(utils_1.toBoolean),
|
|
118
122
|
});
|
|
119
123
|
includedFiles.forEach((file) => {
|
|
120
|
-
this.addDependency(path_1.normalize(file));
|
|
124
|
+
this.addDependency((0, path_1.normalize)(file));
|
|
121
125
|
});
|
|
122
126
|
let output = (result === null || result === void 0 ? void 0 : result.code) || '';
|
|
123
127
|
if (options.extract && foundCSSRules.length) {
|
|
@@ -126,7 +130,7 @@ async function compiledLoader(code) {
|
|
|
126
130
|
// The benefit is two fold:
|
|
127
131
|
// (1) thread safe collection of styles
|
|
128
132
|
// (2) caching -- resulting in faster builds (one import per rule!)
|
|
129
|
-
const params = utils_2.toURIComponent(rule);
|
|
133
|
+
const params = (0, utils_2.toURIComponent)(rule);
|
|
130
134
|
// We use require instead of import so it works with both ESM and CJS source.
|
|
131
135
|
// If we used ESM it would blow up with CJS source, unfortunately.
|
|
132
136
|
output = `
|
|
@@ -138,7 +142,7 @@ async function compiledLoader(code) {
|
|
|
138
142
|
}
|
|
139
143
|
catch (e) {
|
|
140
144
|
// @ts-expect-error Not checking for error type
|
|
141
|
-
const error = utils_1.createError('compiled-loader', 'Unhandled exception')(e.stack);
|
|
145
|
+
const error = (0, utils_1.createError)('compiled-loader', 'Unhandled exception')(e.stack);
|
|
142
146
|
callback(error);
|
|
143
147
|
}
|
|
144
148
|
}
|
|
@@ -147,7 +151,7 @@ function pitch() {
|
|
|
147
151
|
const options = getLoaderOptions(this);
|
|
148
152
|
// @ts-expect-error No definitions for this[pluginName]
|
|
149
153
|
if (!hasErrored && options.extract && !this[extract_plugin_1.pluginName]) {
|
|
150
|
-
this.emitError(utils_1.createError('webpack-loader')(`You forgot to add the 'CompiledExtractPlugin' plugin (i.e \`{ plugins: [new CompiledExtractPlugin()] }\`), please read https://compiledcssinjs.com/docs/css-extraction-webpack`));
|
|
154
|
+
this.emitError((0, utils_1.createError)('webpack-loader')(`You forgot to add the 'CompiledExtractPlugin' plugin (i.e \`{ plugins: [new CompiledExtractPlugin()] }\`), please read https://compiledcssinjs.com/docs/css-extraction-webpack`));
|
|
151
155
|
// We only want to error once, if we didn't do this you'd get an error for every file found.
|
|
152
156
|
hasErrored = true;
|
|
153
157
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiled-loader.js","sourceRoot":"","sources":["../src/compiled-loader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,+BAA0C;AAE1C,sCAAgE;AAChE,2CAAyD;AACzD,uDAA0E;AAC1E,+CAA0C;AAG1C,qDAA8C;AAE9C,mCAAyC;AAEzC,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,OAA6C;IACrE,MAAM,EACJ,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,SAAS,EACvB,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"compiled-loader.js","sourceRoot":"","sources":["../src/compiled-loader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,+BAA0C;AAE1C,sCAAgE;AAChE,2CAAyD;AACzD,uDAA0E;AAC1E,+CAA0C;AAG1C,qDAA8C;AAE9C,mCAAyC;AAEzC,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,OAA6C;IACrE,MAAM,EACJ,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,SAAS,EACvB,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,EAAE,EACZ,UAAU,GAAG,SAAS,GACvB,GAA0B,OAAO,OAAO,CAAC,UAAU,KAAK,WAAW;QAClE,CAAC,CAAC,kBA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1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
15
|
-
var
|
|
13
|
+
var _CompiledExtractPlugin_options;
|
|
16
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
15
|
exports.CompiledExtractPlugin = exports.styleSheetName = exports.pluginName = void 0;
|
|
18
16
|
const css_1 = require("@compiled/css");
|
|
@@ -73,7 +71,7 @@ const forceCSSIntoOneStyleSheet = (compiler) => {
|
|
|
73
71
|
*/
|
|
74
72
|
const pushNodeModulesExtractLoader = (compiler, options) => {
|
|
75
73
|
if (!compiler.options.module) {
|
|
76
|
-
throw utils_1.createError('webpack-loader')('module options not defined');
|
|
74
|
+
throw (0, utils_1.createError)('webpack-loader')('module options not defined');
|
|
77
75
|
}
|
|
78
76
|
compiler.options.module.rules.push({
|
|
79
77
|
test: { and: [/node_modules.+\.js$/, options.nodeModulesTest].filter(utils_1.toBoolean) },
|
|
@@ -96,32 +94,32 @@ const pushNodeModulesExtractLoader = (compiler, options) => {
|
|
|
96
94
|
*/
|
|
97
95
|
class CompiledExtractPlugin {
|
|
98
96
|
constructor(options = {}) {
|
|
99
|
-
|
|
100
|
-
__classPrivateFieldSet(this,
|
|
97
|
+
_CompiledExtractPlugin_options.set(this, void 0);
|
|
98
|
+
__classPrivateFieldSet(this, _CompiledExtractPlugin_options, options, "f");
|
|
101
99
|
}
|
|
102
100
|
apply(compiler) {
|
|
103
|
-
const { RawSource } = utils_2.getSources(compiler);
|
|
104
|
-
pushNodeModulesExtractLoader(compiler, __classPrivateFieldGet(this,
|
|
101
|
+
const { RawSource } = (0, utils_2.getSources)(compiler);
|
|
102
|
+
pushNodeModulesExtractLoader(compiler, __classPrivateFieldGet(this, _CompiledExtractPlugin_options, "f"));
|
|
105
103
|
forceCSSIntoOneStyleSheet(compiler);
|
|
106
104
|
compiler.hooks.compilation.tap(exports.pluginName, (compilation) => {
|
|
107
|
-
utils_2.getNormalModuleHook(compiler, compilation).tap(exports.pluginName, (loaderContext) => {
|
|
105
|
+
(0, utils_2.getNormalModuleHook)(compiler, compilation).tap(exports.pluginName, (loaderContext) => {
|
|
108
106
|
// We add some information here to tell loaders that the plugin has been configured.
|
|
109
107
|
// Bundling will throw if this is missing (i.e. consumers did not setup correctly).
|
|
110
108
|
loaderContext[exports.pluginName] = true;
|
|
111
109
|
});
|
|
112
|
-
utils_2.getOptimizeAssetsHook(compiler, compilation).tap(exports.pluginName, (assets) => {
|
|
110
|
+
(0, utils_2.getOptimizeAssetsHook)(compiler, compilation).tap(exports.pluginName, (assets) => {
|
|
113
111
|
const cssAssets = getCSSAssets(assets);
|
|
114
112
|
if (cssAssets.length === 0) {
|
|
115
113
|
return;
|
|
116
114
|
}
|
|
117
115
|
const [asset] = cssAssets;
|
|
118
|
-
const contents = utils_2.getAssetSourceContents(asset.source);
|
|
119
|
-
const newSource = new RawSource(css_1.sort(contents));
|
|
116
|
+
const contents = (0, utils_2.getAssetSourceContents)(asset.source);
|
|
117
|
+
const newSource = new RawSource((0, css_1.sort)(contents));
|
|
120
118
|
compilation.updateAsset(asset.name, newSource, asset.info);
|
|
121
119
|
});
|
|
122
120
|
});
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
exports.CompiledExtractPlugin = CompiledExtractPlugin;
|
|
126
|
-
|
|
124
|
+
_CompiledExtractPlugin_options = new WeakMap();
|
|
127
125
|
//# sourceMappingURL=extract-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-plugin.js","sourceRoot":"","sources":["../src/extract-plugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extract-plugin.js","sourceRoot":"","sources":["../src/extract-plugin.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAAqC;AACrC,2CAAyD;AAIzD,mCAKiB;AAEJ,QAAA,UAAU,GAAG,uBAAuB,CAAC;AACrC,QAAA,cAAc,GAAG,cAAc,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,CAAC,MAA6B,EAAE,EAAE;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SACvB,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE;QACpB,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,sBAAc,MAAM,CAAC,CAAC;IACrD,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AACpF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BAAsB,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACtD,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,IAAA,UAAI,EAAC,QAAQ,CAAC,CAAC,CAAC;gBAEhD,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAlCD,sDAkCC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export interface CompiledLoaderOptions {
|
|
|
25
25
|
* Override the default `resolve` passed into webpack, which is used to statically evaluate import declarations
|
|
26
26
|
*/
|
|
27
27
|
resolve?: ResolveOptions;
|
|
28
|
+
/**
|
|
29
|
+
* List of file extensions to traverse as code
|
|
30
|
+
*/
|
|
31
|
+
extensions?: string[];
|
|
28
32
|
}
|
|
29
33
|
export interface CompiledExtractPluginOptions {
|
|
30
34
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compiled/webpack-loader",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "A familiar and performant compile time CSS-in-JS library for React.",
|
|
5
5
|
"homepage": "https://compiledcssinjs.com/docs/pkg-webpack-loader",
|
|
6
6
|
"bugs": "https://github.com/atlassian-labs/compiled/issues/new?assignees=&labels=bug&template=bug_report.md",
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
"src"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@babel/core": "^7.16.
|
|
24
|
-
"@compiled/babel-plugin": "^0.11.
|
|
25
|
-
"@compiled/babel-plugin-strip-runtime": "^0.11.
|
|
26
|
-
"@compiled/css": "^0.8.
|
|
23
|
+
"@babel/core": "^7.16.5",
|
|
24
|
+
"@compiled/babel-plugin": "^0.11.4",
|
|
25
|
+
"@compiled/babel-plugin-strip-runtime": "^0.11.4",
|
|
26
|
+
"@compiled/css": "^0.8.1",
|
|
27
|
+
"@compiled/react": "0.10.2",
|
|
27
28
|
"@compiled/utils": "^0.6.14",
|
|
28
29
|
"enhanced-resolve": "^5.8.3",
|
|
29
30
|
"loader-utils": "^2.0.2",
|
|
@@ -32,9 +33,12 @@
|
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"babel-loader": "^8.2.3",
|
|
34
35
|
"css-loader": "^5.2.7",
|
|
35
|
-
"memfs": "^3.
|
|
36
|
-
"mini-css-extract-plugin": "^1.
|
|
37
|
-
"
|
|
36
|
+
"memfs": "^3.4.1",
|
|
37
|
+
"mini-css-extract-plugin": "^1.6.2",
|
|
38
|
+
"react": "^17.0.2",
|
|
39
|
+
"ts-node": "^10.4.0",
|
|
40
|
+
"tsconfig-paths": "^3.12.0",
|
|
41
|
+
"webpack": "^5.65.0"
|
|
38
42
|
},
|
|
39
43
|
"peerDependencies": {
|
|
40
44
|
"webpack": ">= 4.46.0"
|
package/src/compiled-loader.tsx
CHANGED
|
@@ -26,6 +26,7 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
|
|
|
26
26
|
importReact = undefined,
|
|
27
27
|
nonce = undefined,
|
|
28
28
|
resolve = {},
|
|
29
|
+
extensions = undefined,
|
|
29
30
|
}: CompiledLoaderOptions = typeof context.getOptions === 'undefined'
|
|
30
31
|
? // Webpack v4 flow
|
|
31
32
|
getOptions(context)
|
|
@@ -48,6 +49,9 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
|
|
|
48
49
|
resolve: {
|
|
49
50
|
type: 'object',
|
|
50
51
|
},
|
|
52
|
+
extensions: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
},
|
|
51
55
|
},
|
|
52
56
|
});
|
|
53
57
|
|
|
@@ -57,6 +61,7 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
|
|
|
57
61
|
importReact,
|
|
58
62
|
nonce,
|
|
59
63
|
resolve,
|
|
64
|
+
extensions,
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
67
|
|
package/src/types.tsx
CHANGED
|
@@ -31,6 +31,11 @@ export interface CompiledLoaderOptions {
|
|
|
31
31
|
* Override the default `resolve` passed into webpack, which is used to statically evaluate import declarations
|
|
32
32
|
*/
|
|
33
33
|
resolve?: ResolveOptions;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List of file extensions to traverse as code
|
|
37
|
+
*/
|
|
38
|
+
extensions?: string[];
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
export interface CompiledExtractPluginOptions {
|