@compiled/webpack-loader 0.7.2 → 0.7.3
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 +17 -0
- package/dist/__fixtures__/babel.d.ts +1 -0
- package/dist/__fixtures__/babel.js.map +1 -1
- package/dist/__fixtures__/binding-not-found.d.ts +1 -1
- package/dist/__fixtures__/binding-not-found.js +6 -9
- package/dist/__fixtures__/binding-not-found.js.map +1 -1
- package/dist/__fixtures__/common/css-prop.d.ts +1 -1
- package/dist/__fixtures__/common/css-prop.js +3 -6
- package/dist/__fixtures__/common/css-prop.js.map +1 -1
- package/dist/__fixtures__/compiled-error.d.ts +1 -0
- package/dist/__fixtures__/compiled-error.js +4 -7
- package/dist/__fixtures__/compiled-error.js.map +1 -1
- package/dist/__fixtures__/important-styles.d.ts +1 -1
- package/dist/__fixtures__/important-styles.js +3 -6
- package/dist/__fixtures__/important-styles.js.map +1 -1
- package/dist/__fixtures__/loader-alias.d.ts +1 -0
- package/dist/__fixtures__/loader-alias.js +5 -5
- package/dist/__fixtures__/loader-alias.js.map +1 -1
- package/dist/__fixtures__/local-styles.d.ts +1 -0
- package/dist/__fixtures__/local-styles.js +7 -9
- package/dist/__fixtures__/local-styles.js.map +1 -1
- package/dist/__fixtures__/relative-styles.d.ts +2 -2
- package/dist/__fixtures__/relative-styles.js +8 -10
- package/dist/__fixtures__/relative-styles.js.map +1 -1
- package/dist/__fixtures__/webpack-alias.d.ts +1 -0
- package/dist/__fixtures__/webpack-alias.js +5 -5
- package/dist/__fixtures__/webpack-alias.js.map +1 -1
- package/dist/compiled-loader.js +2 -2
- package/dist/compiled-loader.js.map +1 -1
- package/dist/css-loader.js +4 -1
- package/dist/css-loader.js.map +1 -1
- package/dist/extract-plugin.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +5 -5
- package/src/__fixtures__/babel.tsx +1 -0
- package/src/__fixtures__/binding-not-found.tsx +2 -1
- package/src/__fixtures__/common/css-prop.tsx +3 -2
- package/src/__fixtures__/compiled-error.tsx +2 -2
- package/src/__fixtures__/important-styles.tsx +2 -2
- package/src/__fixtures__/lib/babel-cjs.d.ts +3 -0
- package/src/__fixtures__/lib/babel-esm.d.ts +3 -0
- package/src/__fixtures__/loader-alias.tsx +4 -4
- package/src/__fixtures__/local-styles.tsx +5 -4
- package/src/__fixtures__/relative-styles.tsx +6 -4
- package/src/__fixtures__/webpack-alias.tsx +4 -4
- package/src/__tests__/compiled-loader.test.tsx +1 -0
- package/src/__tests__/extract-plugin.test.tsx +12 -17
- package/src/__tests__/test-utils.tsx +3 -2
- package/src/compiled-loader.tsx +5 -4
- package/src/css-loader.tsx +5 -1
- package/src/extract-plugin.tsx +3 -2
- package/src/utils.tsx +1 -1
- package/dist/__fixtures__/lib/babel-cjs.d.ts +0 -3
- package/dist/__fixtures__/lib/babel-cjs.js +0 -129
- package/dist/__fixtures__/lib/babel-cjs.js.map +0 -1
- package/dist/__fixtures__/lib/babel-esm.d.ts +0 -1
- package/dist/__fixtures__/lib/babel-esm.js +0 -128
- package/dist/__fixtures__/lib/babel-esm.js.map +0 -1
- package/dist/__tests__/test-utils.d.ts +0 -8
- package/dist/__tests__/test-utils.js +0 -91
- package/dist/__tests__/test-utils.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @compiled/webpack-loader
|
|
2
2
|
|
|
3
|
+
## 0.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 427cead: Compiled now supports turning on the `css` prop using jsx pragmas (both with `@jsx` and `@jsxImportSource`).
|
|
8
|
+
- 79cfb08: Internal refactor changing how the TypeScript compiler picks up source files.
|
|
9
|
+
- 79cfb08: Compiled's CSS loader now uses referential equality instead of pathname to determine if it needs to re-order itself from the last to first.
|
|
10
|
+
- Updated dependencies [79cfb08]
|
|
11
|
+
- Updated dependencies [14368bb]
|
|
12
|
+
- Updated dependencies [68ebac3]
|
|
13
|
+
- Updated dependencies [427cead]
|
|
14
|
+
- Updated dependencies [79cfb08]
|
|
15
|
+
- @compiled/babel-plugin@0.11.1
|
|
16
|
+
- @compiled/babel-plugin-strip-runtime@0.11.1
|
|
17
|
+
- @compiled/css@0.7.1
|
|
18
|
+
- @compiled/utils@0.6.12
|
|
19
|
+
|
|
3
20
|
## 0.7.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel.js","sourceRoot":"","sources":["../../src/__fixtures__/babel.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"babel.js","sourceRoot":"","sources":["../../src/__fixtures__/babel.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,gEAAuC;AACvC,gEAAuC;AAEhC,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,CACpC;IACE,8BAAC,mBAAQ,OAAG;IACZ,8BAAC,mBAAQ,OAAG,CACX,CACJ,CAAC;AALW,QAAA,GAAG,OAKd"}
|
|
@@ -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("../../../react/src/styled").StyledProps>;
|
|
3
3
|
interface HeaderProps {
|
|
4
4
|
variant?: 'default' | 'invert';
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -10,15 +10,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
14
|
exports.Header = exports.HeaderSpacing = void 0;
|
|
18
|
-
|
|
19
|
-
const
|
|
15
|
+
/** @jsx jsx */
|
|
16
|
+
const react_1 = require("@compiled/react");
|
|
20
17
|
const height = '9rem';
|
|
21
|
-
const StyledHeader =
|
|
18
|
+
const StyledHeader = react_1.styled.header `
|
|
22
19
|
height: ${height};
|
|
23
20
|
display: flex;
|
|
24
21
|
align-items: center;
|
|
@@ -34,14 +31,14 @@ const StyledHeader = react_2.styled.header `
|
|
|
34
31
|
${(props) => (props.variant === 'default' ? 'rgba(135, 119, 217, 0.2)' : 'transparent')};
|
|
35
32
|
color: ${(props) => props.color};
|
|
36
33
|
`;
|
|
37
|
-
exports.HeaderSpacing =
|
|
34
|
+
exports.HeaderSpacing = react_1.styled.div `
|
|
38
35
|
height: ${height};
|
|
39
36
|
`;
|
|
40
37
|
const Header = (_a) => {
|
|
41
38
|
var { children, variant = 'default' } = _a, props = __rest(_a, ["children", "variant"]);
|
|
42
39
|
const color = variant === 'default' ? 'rgba(37, 56, 88, 0.9)' : 'rgba(255, 255, 255, 0.75)';
|
|
43
|
-
return (react_1.
|
|
44
|
-
react_1.
|
|
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"),
|
|
45
42
|
children));
|
|
46
43
|
};
|
|
47
44
|
exports.Header = Header;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-not-found.js","sourceRoot":"","sources":["../../src/__fixtures__/binding-not-found.tsx"],"names":[],"mappings":"
|
|
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,EAAwD,EAAe,EAAE;QAAzE,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,OAAyB,EAApB,KAAK,cAAzC,uBAA2C,CAAF;IAC9D,MAAM,KAAK,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAE5F,OAAO,CACL,YAAC,YAAY,kBAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,IAAM,KAAK;QACrD,mBAAG,IAAI,EAAC,GAAG,EAAC,GAAG,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,eAE9D;QACH,QAAQ,CACI,CAChB,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,MAAM,UAWjB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export declare const Coral: () => JSX.Element;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Coral = void 0;
|
|
7
|
-
|
|
8
|
-
require("@compiled/react");
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
const react_1 = require("@compiled/react");
|
|
9
6
|
const colors_1 = require("./colors");
|
|
10
|
-
const Coral = () => (react_1.
|
|
7
|
+
const Coral = () => (react_1.jsx("div", { css: { color: colors_1.coral, border: `2px solid ${colors_1.coral}` } }));
|
|
11
8
|
exports.Coral = Coral;
|
|
12
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":"
|
|
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,qBAAK,GAAG,EAAE,EAAE,KAAK,EAAE,cAAK,EAAE,MAAM,EAAE,aAAa,cAAK,EAAE,EAAE,GAAI,CAC7D,CAAC;AAFW,QAAA,KAAK,SAEhB"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.App = void 0;
|
|
7
|
-
|
|
8
|
-
const
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
const react_1 = require("@compiled/react");
|
|
9
6
|
// @ts-expect-error
|
|
10
|
-
const styles =
|
|
11
|
-
const App = () => react_1.
|
|
7
|
+
const styles = react_1.css(false);
|
|
8
|
+
const App = () => react_1.jsx("div", { css: styles });
|
|
12
9
|
exports.App = App;
|
|
13
10
|
//# sourceMappingURL=compiled-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiled-error.js","sourceRoot":"","sources":["../../src/__fixtures__/compiled-error.tsx"],"names":[],"mappings":"
|
|
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,CAAC,KAAK,CAAC,CAAC;AAEnB,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,qBAAK,GAAG,EAAE,MAAM,GAAI,CAAC;AAA9C,QAAA,GAAG,OAA2C"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
require("@compiled/react");
|
|
8
|
-
const Component = () => react_1.
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
const react_1 = require("@compiled/react");
|
|
5
|
+
const Component = () => react_1.jsx("div", { css: { fontSize: '12!important', color: 'blue' } });
|
|
9
6
|
exports.default = Component;
|
|
10
7
|
//# sourceMappingURL=important-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"important-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/important-styles.tsx"],"names":[],"mappings":"
|
|
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,qBAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,GAAI,CAAC;AAE/F,kBAAe,SAAS,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.App = void 0;
|
|
7
|
-
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
// @ts-ignore This is a bug where the meta is not updated for the new file import
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
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.
|
|
10
|
+
const App = () => 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":"
|
|
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,qBAAK,GAAG,EAAE,qBAAM,GAAI,CAAC;AAA9C,QAAA,GAAG,OAA2C"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.App = void 0;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
const react_1 = require("@compiled/react");
|
|
6
|
+
const react_2 = require("react");
|
|
7
|
+
const Styled = react_1.styled.div({
|
|
10
8
|
color: 'blue',
|
|
11
9
|
});
|
|
12
|
-
const App = () => (react_1.
|
|
13
|
-
react_1.
|
|
14
|
-
react_1.
|
|
10
|
+
const App = () => (react_1.jsx(react_2.Fragment, null,
|
|
11
|
+
react_1.jsx("div", { css: { fontSize: 14 } }),
|
|
12
|
+
react_1.jsx(Styled, null)));
|
|
15
13
|
exports.App = App;
|
|
16
14
|
//# sourceMappingURL=local-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/local-styles.tsx"],"names":[],"mappings":"
|
|
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,YAAC,gBAAQ;IACP,qBAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAI;IAC9B,YAAC,MAAM,OAAG,CACD,CACZ,CAAC;AALW,QAAA,GAAG,OAKd"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Styled:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Styled: import("react").ComponentType<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & import("../../../react/src/styled").StyledProps>;
|
|
3
3
|
export declare const App: () => JSX.Element;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.App = exports.Styled = void 0;
|
|
7
|
-
|
|
8
|
-
const
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
const react_1 = require("@compiled/react");
|
|
6
|
+
const react_2 = require("react");
|
|
9
7
|
const colors_1 = require("./common/colors");
|
|
10
|
-
exports.Styled =
|
|
8
|
+
exports.Styled = react_1.styled.span `
|
|
11
9
|
color: ${colors_1.blueviolet};
|
|
12
10
|
|
|
13
11
|
:focus {
|
|
@@ -18,7 +16,7 @@ exports.Styled = react_2.styled.span `
|
|
|
18
16
|
color: ${colors_1.blue};
|
|
19
17
|
}
|
|
20
18
|
`;
|
|
21
|
-
const styles =
|
|
19
|
+
const styles = react_1.css `
|
|
22
20
|
color: ${colors_1.red};
|
|
23
21
|
|
|
24
22
|
:focus {
|
|
@@ -29,8 +27,8 @@ const styles = react_2.css `
|
|
|
29
27
|
color: ${colors_1.yellow};
|
|
30
28
|
}
|
|
31
29
|
`;
|
|
32
|
-
const App = () => (react_1.
|
|
33
|
-
react_1.
|
|
34
|
-
react_1.
|
|
30
|
+
const App = () => (react_1.jsx(react_2.Fragment, null,
|
|
31
|
+
react_1.jsx("div", { css: styles }),
|
|
32
|
+
react_1.jsx(exports.Styled, null)));
|
|
35
33
|
exports.App = App;
|
|
36
34
|
//# sourceMappingURL=relative-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative-styles.js","sourceRoot":"","sources":["../../src/__fixtures__/relative-styles.tsx"],"names":[],"mappings":"
|
|
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,CAAA;WACP,YAAG;;;aAGD,eAAM;;;;aAIN,eAAM;;CAElB,CAAC;AAEK,MAAM,GAAG,GAAG,GAAgB,EAAE,CAAC,CACpC,YAAC,gBAAQ;IACP,qBAAK,GAAG,EAAE,MAAM,GAAI;IACpB,YAAC,cAAM,OAAG,CACD,CACZ,CAAC;AALW,QAAA,GAAG,OAKd"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.App = void 0;
|
|
7
|
-
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
// @ts-expect-error This is a bug where the meta is not updated for the new file import
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
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.
|
|
10
|
+
const App = () => 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":"
|
|
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,qBAAK,GAAG,EAAE,sBAAM,GAAI,CAAC;AAA9C,QAAA,GAAG,OAA2C"}
|
package/dist/compiled-loader.js
CHANGED
|
@@ -15,12 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.pitch = void 0;
|
|
18
|
+
const fs_1 = __importDefault(require("fs"));
|
|
19
|
+
const path_1 = require("path");
|
|
18
20
|
const core_1 = require("@babel/core");
|
|
19
21
|
const utils_1 = require("@compiled/utils");
|
|
20
22
|
const enhanced_resolve_1 = require("enhanced-resolve");
|
|
21
|
-
const fs_1 = __importDefault(require("fs"));
|
|
22
23
|
const loader_utils_1 = require("loader-utils");
|
|
23
|
-
const path_1 = require("path");
|
|
24
24
|
const extract_plugin_1 = require("./extract-plugin");
|
|
25
25
|
const utils_2 = require("./utils");
|
|
26
26
|
let hasErrored = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiled-loader.js","sourceRoot":"","sources":["../src/compiled-loader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sCAAgE;AAChE,2CAAyD;AACzD,uDAA0E;AAC1E
|
|
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,GACb,GAA0B,OAAO,OAAO,CAAC,UAAU,KAAK,WAAW;QAClE,CAAC,CAAC,kBAAkB;YAClB,yBAAU,CAAC,OAAO,CAAC;QACrB,CAAC,CAAC,kBAAkB;YAClB,OAAO,CAAC,UAAU,CAAC;gBACjB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAA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CAAC,CAAC,IAAI,EAAE,EAAE;gBAC7B,mGAAmG;gBACnG,2BAA2B;gBAC3B,uCAAuC;gBACvC,mEAAmE;gBACnE,MAAM,MAAM,GAAG,sBAAc,CAAC,IAAI,CAAC,CAAC;gBAEpC,6EAA6E;gBAC7E,kEAAkE;gBAClE,MAAM,GAAG;uGACsF,MAAM;IACzG,MAAM,EAAE,CAAC;YACP,CAAC,CAAC,CAAC;SACJ;QAED,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,SAAS,CAAC,CAAC;KAClD;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,KAAK,GAAG,mBAAW,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC7E,QAAQ,CAAC,KAAK,CAAC,CAAC;KACjB;AACH,CAAC;AAzFD,iCAyFC;AAED,SAAgB,KAAK;IACnB,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAEvC,uDAAuD;IACvD,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAU,CAAC,EAAE;QACvD,IAAI,CAAC,SAAS,CACZ,mBAAW,CAAC,gBAAgB,CAAC,CAC3B,gLAAgL,CACjL,CACF,CAAC;QAEF,4FAA4F;QAC5F,UAAU,GAAG,IAAI,CAAC;KACnB;AACH,CAAC;AAdD,sBAcC"}
|
package/dist/css-loader.js
CHANGED
|
@@ -15,9 +15,12 @@ exports.default = CSSLoader;
|
|
|
15
15
|
* Moves CSSloader to the end of the loader queue so it runs first.
|
|
16
16
|
*/
|
|
17
17
|
function pitch() {
|
|
18
|
-
if (this.loaders[0].
|
|
18
|
+
if (this.loaders[0].pitch !== pitch) {
|
|
19
|
+
// If the first loader isn't this one - skip.
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
22
|
+
// The first loader is Compiled's css-loader - we need to shift
|
|
23
|
+
// it to be at the end of the loader chain so it runs first (instead of last).
|
|
21
24
|
const firstLoader = this.loaders.shift();
|
|
22
25
|
this.loaders.push(firstLoader);
|
|
23
26
|
}
|
package/dist/css-loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-loader.js","sourceRoot":"","sources":["../src/css-loader.tsx"],"names":[],"mappings":";;;AAAA,6BAAsC;
|
|
1
|
+
{"version":3,"file":"css-loader.js","sourceRoot":"","sources":["../src/css-loader.tsx"],"names":[],"mappings":";;;AAAA,6BAAsC;AAItC;;GAEG;AACH,SAAwB,SAAS;IAC/B,MAAM,KAAK,GAAG,IAAI,qBAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,SAAS,IAAI,EAAE,CAAC;AACzB,CAAC;AAJD,4BAIC;AAED;;GAEG;AACH,SAAgB,KAAK;IACnB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,EAAE;QACnC,6CAA6C;QAC7C,OAAO;KACR;IAED,+DAA+D;IAC/D,8EAA8E;IAC9E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAY,CAAC,CAAC;AAClC,CAAC;AAVD,sBAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-plugin.js","sourceRoot":"","sources":["../src/extract-plugin.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAqC;AACrC,2CAAyD;
|
|
1
|
+
{"version":3,"file":"extract-plugin.js","sourceRoot":"","sources":["../src/extract-plugin.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAqC;AACrC,2CAAyD;AAIzD,mCAKiB;AAEJ,QA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E,EAAE;gBAC3E,oFAAoF;gBACpF,mFAAmF;gBAClF,aAAqB,CAAC,kBAAU,CAAC,GAAG,IAAI,CAAC;YAC5C,CAAC,CAAC,CAAC;YAEH,6BAAqB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAU,EAAE,CAAC,MAAM,EAAE,EAAE;gBACtE,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;gBACvC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;oBAC1B,OAAO;iBACR;gBAED,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;gBAC1B,MAAM,QAAQ,GAAG,8BAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACtD,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,UAAI,CAAC,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/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compiled/webpack-loader",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "A familiar and performant compile time CSS-in-JS library for React.",
|
|
5
5
|
"homepage": "https://compiledcssinjs.com",
|
|
6
6
|
"bugs": "https://github.com/atlassian-labs/compiled/issues/new?assignees=&labels=bug&template=bug_report.md",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/core": "^7.16.0",
|
|
25
|
-
"@compiled/babel-plugin": "^0.11.
|
|
26
|
-
"@compiled/babel-plugin-strip-runtime": "^0.
|
|
27
|
-
"@compiled/css": "^0.7.
|
|
28
|
-
"@compiled/utils": "^0.6.
|
|
25
|
+
"@compiled/babel-plugin": "^0.11.1",
|
|
26
|
+
"@compiled/babel-plugin-strip-runtime": "^0.11.1",
|
|
27
|
+
"@compiled/css": "^0.7.1",
|
|
28
|
+
"@compiled/utils": "^0.6.12",
|
|
29
29
|
"enhanced-resolve": "^5.8.3",
|
|
30
30
|
"loader-utils": "^2.0.2",
|
|
31
31
|
"webpack-sources": "^1.4.3"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
// @ts-expect-error
|
|
3
|
-
import { styles } from 'loader-alias';
|
|
1
|
+
/** @jsx jsx */
|
|
4
2
|
// @ts-ignore This is a bug where the meta is not updated for the new file import
|
|
5
3
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
-
import { css } from '@compiled/react';
|
|
4
|
+
import { jsx, css } from '@compiled/react';
|
|
5
|
+
// @ts-expect-error
|
|
6
|
+
import { styles } from 'loader-alias';
|
|
7
7
|
|
|
8
8
|
export const App = (): JSX.Element => <div css={styles} />;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import { styled } from '@compiled/react';
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, styled } from '@compiled/react';
|
|
3
|
+
import { Fragment } from 'react';
|
|
3
4
|
|
|
4
5
|
const Styled = styled.div({
|
|
5
6
|
color: 'blue',
|
|
6
7
|
});
|
|
7
8
|
|
|
8
9
|
export const App = (): JSX.Element => (
|
|
9
|
-
|
|
10
|
+
<Fragment>
|
|
10
11
|
<div css={{ fontSize: 14 }} />
|
|
11
12
|
<Styled />
|
|
12
|
-
|
|
13
|
+
</Fragment>
|
|
13
14
|
);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { css, styled } from '@compiled/react';
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, css, styled } from '@compiled/react';
|
|
3
|
+
import { Fragment } from 'react';
|
|
4
|
+
|
|
3
5
|
import { blueviolet, blue, orange, purple, red, yellow } from './common/colors';
|
|
4
6
|
// @ts-expect-error ↓↓↓ This should not have their styles extracted ↓↓↓
|
|
5
7
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -30,8 +32,8 @@ const styles = css`
|
|
|
30
32
|
`;
|
|
31
33
|
|
|
32
34
|
export const App = (): JSX.Element => (
|
|
33
|
-
|
|
35
|
+
<Fragment>
|
|
34
36
|
<div css={styles} />
|
|
35
37
|
<Styled />
|
|
36
|
-
|
|
38
|
+
</Fragment>
|
|
37
39
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
// @ts-expect-error
|
|
3
|
-
import { styles } from 'webpack-alias';
|
|
1
|
+
/** @jsx jsx */
|
|
4
2
|
// @ts-expect-error This is a bug where the meta is not updated for the new file import
|
|
5
3
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
-
import { css } from '@compiled/react';
|
|
4
|
+
import { jsx, css } from '@compiled/react';
|
|
5
|
+
// @ts-expect-error
|
|
6
|
+
import { styles } from 'webpack-alias';
|
|
7
7
|
|
|
8
8
|
export const App = (): JSX.Element => <div css={styles} />;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
|
+
|
|
2
3
|
import { bundle as bundleEntry } from './test-utils';
|
|
3
4
|
import type { BundleOptions } from './test-utils';
|
|
4
5
|
|
|
@@ -23,7 +24,7 @@ describe('CompiledExtractPlugin', () => {
|
|
|
23
24
|
message: expect.stringContaining("You forgot to add the 'CompiledExtractPlugin' plugin"),
|
|
24
25
|
}),
|
|
25
26
|
]);
|
|
26
|
-
});
|
|
27
|
+
}, 10000);
|
|
27
28
|
|
|
28
29
|
it('extracts local styles', async () => {
|
|
29
30
|
const actual = await bundle(join(fixturesPath, 'local-styles.tsx'));
|
|
@@ -33,7 +34,7 @@ describe('CompiledExtractPlugin', () => {
|
|
|
33
34
|
._syaz13q2{color:blue}
|
|
34
35
|
"
|
|
35
36
|
`);
|
|
36
|
-
});
|
|
37
|
+
}, 10000);
|
|
37
38
|
|
|
38
39
|
it('extracts styles imported through a relative path', async () => {
|
|
39
40
|
const actual = await bundle(join(fixturesPath, 'relative-styles.tsx'));
|
|
@@ -49,7 +50,7 @@ describe('CompiledExtractPlugin', () => {
|
|
|
49
50
|
._30l313q2:hover{color:blue}
|
|
50
51
|
"
|
|
51
52
|
`);
|
|
52
|
-
});
|
|
53
|
+
}, 10000);
|
|
53
54
|
|
|
54
55
|
it('extracts styles imported through a webpack alias', async () => {
|
|
55
56
|
const assets = await bundle(join(fixturesPath, 'webpack-alias.tsx'));
|
|
@@ -58,7 +59,7 @@ describe('CompiledExtractPlugin', () => {
|
|
|
58
59
|
"._syaz13q2{color:blue}
|
|
59
60
|
"
|
|
60
61
|
`);
|
|
61
|
-
});
|
|
62
|
+
}, 10000);
|
|
62
63
|
|
|
63
64
|
it('extracts styles imported through an overridden resolve configuration', async () => {
|
|
64
65
|
const assets = await bundle(join(fixturesPath, 'loader-alias.tsx'), {
|
|
@@ -74,20 +75,14 @@ describe('CompiledExtractPlugin', () => {
|
|
|
74
75
|
"._syaz1if8{color:indigo}
|
|
75
76
|
"
|
|
76
77
|
`);
|
|
77
|
-
});
|
|
78
|
+
}, 10000);
|
|
78
79
|
|
|
79
80
|
it('extracts styles from an async chunk', async () => {
|
|
80
81
|
const actual = await bundle(join(fixturesPath, 'async-styles.ts'));
|
|
81
82
|
|
|
82
83
|
// Only generate one CSS bundle
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"main.js",
|
|
86
|
-
"377.js",
|
|
87
|
-
"static/compiled-css.css",
|
|
88
|
-
"377.js.LICENSE.txt",
|
|
89
|
-
]
|
|
90
|
-
`);
|
|
84
|
+
const cssFiles = Object.keys(actual).filter((key) => key.endsWith('.css'));
|
|
85
|
+
expect(cssFiles).toHaveLength(1);
|
|
91
86
|
|
|
92
87
|
// Extract the styles into said bundle
|
|
93
88
|
expect(actual[assetName]).toMatchInlineSnapshot(`
|
|
@@ -95,7 +90,7 @@ describe('CompiledExtractPlugin', () => {
|
|
|
95
90
|
._syaz1vyr{color:coral}
|
|
96
91
|
"
|
|
97
92
|
`);
|
|
98
|
-
});
|
|
93
|
+
}, 10000);
|
|
99
94
|
|
|
100
95
|
it('extracts styles from a pre-built babel files', async () => {
|
|
101
96
|
const actual = await bundle(join(fixturesPath, 'babel.tsx'));
|
|
@@ -111,7 +106,7 @@ describe('CompiledExtractPlugin', () => {
|
|
|
111
106
|
._syaz13q2{color:blue}
|
|
112
107
|
"
|
|
113
108
|
`);
|
|
114
|
-
});
|
|
109
|
+
}, 10000);
|
|
115
110
|
|
|
116
111
|
it('extracts important styles', async () => {
|
|
117
112
|
const actual = await bundle(join(fixturesPath, 'important-styles.tsx'));
|
|
@@ -121,7 +116,7 @@ describe('CompiledExtractPlugin', () => {
|
|
|
121
116
|
._1wybc038{font-size:12!important}
|
|
122
117
|
"
|
|
123
118
|
`);
|
|
124
|
-
});
|
|
119
|
+
}, 10000);
|
|
125
120
|
|
|
126
121
|
it('should find bindings', async () => {
|
|
127
122
|
const actual = await bundle(join(fixturesPath, 'binding-not-found.tsx'));
|
|
@@ -152,5 +147,5 @@ describe('CompiledExtractPlugin', () => {
|
|
|
152
147
|
._4t3i1jdh{height:9rem}
|
|
153
148
|
"
|
|
154
149
|
`);
|
|
155
|
-
});
|
|
150
|
+
}, 10000);
|
|
156
151
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createFsFromVolume, Volume } from 'memfs';
|
|
2
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
3
1
|
import { join } from 'path';
|
|
2
|
+
|
|
3
|
+
import { Volume, createFsFromVolume } from 'memfs';
|
|
4
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
4
5
|
import webpack from 'webpack';
|
|
5
6
|
|
|
6
7
|
import { CompiledExtractPlugin } from '../index';
|
package/src/compiled-loader.tsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { transformFromAstAsync, parseAsync } from '@babel/core';
|
|
2
|
-
import { toBoolean, createError } from '@compiled/utils';
|
|
3
|
-
import { CachedInputFileSystem, ResolverFactory } from 'enhanced-resolve';
|
|
4
1
|
import fs from 'fs';
|
|
5
|
-
import { getOptions } from 'loader-utils';
|
|
6
2
|
import { dirname, normalize } from 'path';
|
|
3
|
+
|
|
4
|
+
import { parseAsync, transformFromAstAsync } from '@babel/core';
|
|
5
|
+
import { createError, toBoolean } from '@compiled/utils';
|
|
6
|
+
import { CachedInputFileSystem, ResolverFactory } from 'enhanced-resolve';
|
|
7
|
+
import { getOptions } from 'loader-utils';
|
|
7
8
|
import type { LoaderContext } from 'webpack';
|
|
8
9
|
|
|
9
10
|
import { pluginName } from './extract-plugin';
|
package/src/css-loader.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { URLSearchParams } from 'url';
|
|
2
|
+
|
|
2
3
|
import type { LoaderContext } from 'webpack';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -14,10 +15,13 @@ export default function CSSLoader(this: LoaderContext<void>): string {
|
|
|
14
15
|
* Moves CSSloader to the end of the loader queue so it runs first.
|
|
15
16
|
*/
|
|
16
17
|
export function pitch(this: LoaderContext<void>): void {
|
|
17
|
-
if (this.loaders[0].
|
|
18
|
+
if (this.loaders[0].pitch !== pitch) {
|
|
19
|
+
// If the first loader isn't this one - skip.
|
|
18
20
|
return;
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
// The first loader is Compiled's css-loader - we need to shift
|
|
24
|
+
// it to be at the end of the loader chain so it runs first (instead of last).
|
|
21
25
|
const firstLoader = this.loaders.shift();
|
|
22
26
|
this.loaders.push(firstLoader!);
|
|
23
27
|
}
|
package/src/extract-plugin.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { sort } from '@compiled/css';
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
2
|
+
import { createError, toBoolean } from '@compiled/utils';
|
|
3
|
+
import type { Compilation, Compiler } from 'webpack';
|
|
4
|
+
|
|
4
5
|
import type { CompiledExtractPluginOptions } from './types';
|
|
5
6
|
import {
|
|
6
7
|
getAssetSourceContents,
|
package/src/utils.tsx
CHANGED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/* index.js generated by @compiled/babel-plugin v0.6.7 */
|
|
2
|
-
'use strict';
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true,
|
|
5
|
-
});
|
|
6
|
-
exports.default = BabelComponent;
|
|
7
|
-
var _react = require('react');
|
|
8
|
-
var _runtime = require('@compiled/react/runtime');
|
|
9
|
-
var _jsxRuntime = require('react/jsx-runtime');
|
|
10
|
-
var _8 = '._19pk1ul9{margin-top:30px}';
|
|
11
|
-
function ownKeys(object, enumerableOnly) {
|
|
12
|
-
var keys = Object.keys(object);
|
|
13
|
-
if (Object.getOwnPropertySymbols) {
|
|
14
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
15
|
-
if (enumerableOnly)
|
|
16
|
-
symbols = symbols.filter(function (sym) {
|
|
17
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
18
|
-
});
|
|
19
|
-
keys.push.apply(keys, symbols);
|
|
20
|
-
}
|
|
21
|
-
return keys;
|
|
22
|
-
}
|
|
23
|
-
function _objectSpread(target) {
|
|
24
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
25
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
26
|
-
if (i % 2) {
|
|
27
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
28
|
-
_defineProperty(target, key, source[key]);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
else if (Object.getOwnPropertyDescriptors) {
|
|
32
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
36
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
}
|
|
42
|
-
function _defineProperty(obj, key, value) {
|
|
43
|
-
if (key in obj) {
|
|
44
|
-
Object.defineProperty(obj, key, {
|
|
45
|
-
value: value,
|
|
46
|
-
enumerable: true,
|
|
47
|
-
configurable: true,
|
|
48
|
-
writable: true,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
obj[key] = value;
|
|
53
|
-
}
|
|
54
|
-
return obj;
|
|
55
|
-
}
|
|
56
|
-
function _objectWithoutProperties(source, excluded) {
|
|
57
|
-
if (source == null)
|
|
58
|
-
return {};
|
|
59
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
60
|
-
var key, i;
|
|
61
|
-
if (Object.getOwnPropertySymbols) {
|
|
62
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
63
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
64
|
-
key = sourceSymbolKeys[i];
|
|
65
|
-
if (excluded.indexOf(key) >= 0)
|
|
66
|
-
continue;
|
|
67
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
68
|
-
continue;
|
|
69
|
-
target[key] = source[key];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return target;
|
|
73
|
-
}
|
|
74
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
75
|
-
if (source == null)
|
|
76
|
-
return {};
|
|
77
|
-
var target = {};
|
|
78
|
-
var sourceKeys = Object.keys(source);
|
|
79
|
-
var key, i;
|
|
80
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
81
|
-
key = sourceKeys[i];
|
|
82
|
-
if (excluded.indexOf(key) >= 0)
|
|
83
|
-
continue;
|
|
84
|
-
target[key] = source[key];
|
|
85
|
-
}
|
|
86
|
-
return target;
|
|
87
|
-
}
|
|
88
|
-
var _7 = '._19bvftgi{padding-left:8px}';
|
|
89
|
-
var _6 = '._n3tdftgi{padding-bottom:8px}';
|
|
90
|
-
var _5 = '._u5f3ftgi{padding-right:8px}';
|
|
91
|
-
var _4 = '._ca0qftgi{padding-top:8px}';
|
|
92
|
-
var _3 = '._19itlf8h{border:2px solid blue}';
|
|
93
|
-
var _2 = '._1wyb1ul9{font-size:30px}';
|
|
94
|
-
var _ = '._syaz13q2{color:blue}';
|
|
95
|
-
var Button = (0, _react.forwardRef)(function (_ref, ref) {
|
|
96
|
-
var _ref$as = _ref.as, C = _ref$as === void 0 ? 'button' : _ref$as, style = _ref.style, props = _objectWithoutProperties(_ref, ['as', 'style']);
|
|
97
|
-
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_runtime.CC, {
|
|
98
|
-
children: [
|
|
99
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_runtime.CS, {
|
|
100
|
-
children: [_, _2, _3, _4, _5, _6, _7],
|
|
101
|
-
}),
|
|
102
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(C, _objectSpread(_objectSpread({}, props), {}, {
|
|
103
|
-
style: style,
|
|
104
|
-
ref: ref,
|
|
105
|
-
className: (0, _runtime.ax)([
|
|
106
|
-
'_syaz13q2 _1wyb1ul9 _19itlf8h _ca0qftgi _u5f3ftgi _n3tdftgi _19bvftgi',
|
|
107
|
-
props.className,
|
|
108
|
-
]),
|
|
109
|
-
})),
|
|
110
|
-
],
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
function BabelComponent(_ref2) {
|
|
114
|
-
var children = _ref2.children;
|
|
115
|
-
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_runtime.CC, {
|
|
116
|
-
children: [
|
|
117
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_runtime.CS, {
|
|
118
|
-
children: [_8],
|
|
119
|
-
}),
|
|
120
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)('div', {
|
|
121
|
-
className: (0, _runtime.ax)(['_19pk1ul9']),
|
|
122
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Button, {
|
|
123
|
-
children: children,
|
|
124
|
-
}),
|
|
125
|
-
}),
|
|
126
|
-
],
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=babel-cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-cjs.js","sourceRoot":"","sources":["../../../src/__fixtures__/lib/babel-cjs.js"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,YAAY,CAAC;AAEb,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE;IAC3C,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC;AACH,OAAO,CAAC,OAAO,GAAG,cAAc,CAAC;AAEjC,IAAI,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE9B,IAAI,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAElD,IAAI,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE/C,IAAI,EAAE,GAAG,6BAA6B,CAAC;AAEvC,SAAS,OAAO,CAAC,MAAM,EAAE,cAAc;IACrC,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,MAAM,CAAC,qBAAqB,EAAE;QAChC,IAAI,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,cAAc;YAChB,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG;gBACpC,OAAO,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC;YACjE,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAChC;IACD,OAAO,IAA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E,KAAK,EAAE,KAAK;gBACZ,GAAG,EAAE,GAAG;gBACR,SAAS,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;oBAC1B,uEAAuE;oBACvE,KAAK,CAAC,SAAS;iBAChB,CAAC;aACH,CACF,CACF;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,KAAK;IAC3B,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC9B,OAAO,aAAa,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE;QACtD,QAAQ,EAAE;YACR,aAAa,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE;gBAC9C,QAAQ,EAAE,CAAC,EAAE,CAAC;aACf,CAAC;YACF,aAAa,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE;gBACxC,SAAS,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;gBAC1C,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE;oBACnD,QAAQ,EAAE,QAAQ;iBACnB,CAAC;aACH,CAAC;SACH;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function BabelComponent(_ref2: any): any;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* index.js generated by @compiled/babel-plugin v0.6.7 */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
var _8 = '._19pk1ul9{margin-top:30px}';
|
|
6
|
-
function ownKeys(object, enumerableOnly) {
|
|
7
|
-
var keys = Object.keys(object);
|
|
8
|
-
if (Object.getOwnPropertySymbols) {
|
|
9
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
10
|
-
if (enumerableOnly)
|
|
11
|
-
symbols = symbols.filter(function (sym) {
|
|
12
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
13
|
-
});
|
|
14
|
-
keys.push.apply(keys, symbols);
|
|
15
|
-
}
|
|
16
|
-
return keys;
|
|
17
|
-
}
|
|
18
|
-
function _objectSpread(target) {
|
|
19
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
20
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
21
|
-
if (i % 2) {
|
|
22
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
23
|
-
_defineProperty(target, key, source[key]);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
else if (Object.getOwnPropertyDescriptors) {
|
|
27
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
31
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
}
|
|
37
|
-
function _defineProperty(obj, key, value) {
|
|
38
|
-
if (key in obj) {
|
|
39
|
-
Object.defineProperty(obj, key, {
|
|
40
|
-
value: value,
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
obj[key] = value;
|
|
48
|
-
}
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
51
|
-
function _objectWithoutProperties(source, excluded) {
|
|
52
|
-
if (source == null)
|
|
53
|
-
return {};
|
|
54
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
55
|
-
var key, i;
|
|
56
|
-
if (Object.getOwnPropertySymbols) {
|
|
57
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
58
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
59
|
-
key = sourceSymbolKeys[i];
|
|
60
|
-
if (excluded.indexOf(key) >= 0)
|
|
61
|
-
continue;
|
|
62
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
63
|
-
continue;
|
|
64
|
-
target[key] = source[key];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return target;
|
|
68
|
-
}
|
|
69
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
70
|
-
if (source == null)
|
|
71
|
-
return {};
|
|
72
|
-
var target = {};
|
|
73
|
-
var sourceKeys = Object.keys(source);
|
|
74
|
-
var key, i;
|
|
75
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
76
|
-
key = sourceKeys[i];
|
|
77
|
-
if (excluded.indexOf(key) >= 0)
|
|
78
|
-
continue;
|
|
79
|
-
target[key] = source[key];
|
|
80
|
-
}
|
|
81
|
-
return target;
|
|
82
|
-
}
|
|
83
|
-
const runtime_1 = require("@compiled/react/runtime");
|
|
84
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
85
|
-
const jsx_runtime_2 = require("react/jsx-runtime");
|
|
86
|
-
var _7 = '._19bvftgi{padding-left:8px}';
|
|
87
|
-
var _6 = '._n3tdftgi{padding-bottom:8px}';
|
|
88
|
-
var _5 = '._u5f3ftgi{padding-right:8px}';
|
|
89
|
-
var _4 = '._ca0qftgi{padding-top:8px}';
|
|
90
|
-
var _3 = '._19itlf8h{border:2px solid blue}';
|
|
91
|
-
var _2 = '._1wyb1ul9{font-size:30px}';
|
|
92
|
-
var _ = '._syaz13q2{color:blue}';
|
|
93
|
-
var Button = react_1.forwardRef(function (_ref, ref) {
|
|
94
|
-
var _ref$as = _ref.as, C = _ref$as === void 0 ? 'button' : _ref$as, style = _ref.style, props = _objectWithoutProperties(_ref, ['as', 'style']);
|
|
95
|
-
return /*#__PURE__*/ jsx_runtime_2.jsxs(runtime_1.CC, {
|
|
96
|
-
children: [
|
|
97
|
-
/*#__PURE__*/ jsx_runtime_1.jsx(runtime_1.CS, {
|
|
98
|
-
children: [_, _2, _3, _4, _5, _6, _7],
|
|
99
|
-
}),
|
|
100
|
-
/*#__PURE__*/ jsx_runtime_1.jsx(C, _objectSpread(_objectSpread({}, props), {}, {
|
|
101
|
-
style: style,
|
|
102
|
-
ref: ref,
|
|
103
|
-
className: runtime_1.ax([
|
|
104
|
-
'_syaz13q2 _1wyb1ul9 _19itlf8h _ca0qftgi _u5f3ftgi _n3tdftgi _19bvftgi',
|
|
105
|
-
props.className,
|
|
106
|
-
]),
|
|
107
|
-
})),
|
|
108
|
-
],
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
function BabelComponent(_ref2) {
|
|
112
|
-
var children = _ref2.children;
|
|
113
|
-
return /*#__PURE__*/ jsx_runtime_2.jsxs(runtime_1.CC, {
|
|
114
|
-
children: [
|
|
115
|
-
/*#__PURE__*/ jsx_runtime_1.jsx(runtime_1.CS, {
|
|
116
|
-
children: [_8],
|
|
117
|
-
}),
|
|
118
|
-
/*#__PURE__*/ jsx_runtime_1.jsx('div', {
|
|
119
|
-
className: runtime_1.ax(['_19pk1ul9']),
|
|
120
|
-
children: /*#__PURE__*/ jsx_runtime_1.jsx(Button, {
|
|
121
|
-
children: children,
|
|
122
|
-
}),
|
|
123
|
-
}),
|
|
124
|
-
],
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
exports.default = BabelComponent;
|
|
128
|
-
//# sourceMappingURL=babel-esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-esm.js","sourceRoot":"","sources":["../../../src/__fixtures__/lib/babel-esm.js"],"names":[],"mappings":";AAAA,yDAAyD;;AAEzD,iCAAmC;AACnC,IAAI,EAAE,GAAG,6BAA6B,CAAC;AAEvC,SAAS,OAAO,CAAC,MAAM,E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,aAAa,CAAC,kBAAK,CAAC,YAAE,EAAE;QAC7B,QAAQ,EAAE;YACR,aAAa,CAAC,iBAAI,CAAC,YAAE,EAAE;gBACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;aACtC,CAAC;YACF,aAAa,CAAC,iBAAI,CAChB,CAAC,EACD,aAAa,CACX,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,EACxB,EAAE,EACF;gBACE,KAAK,EAAE,KAAK;gBACZ,GAAG,EAAE,GAAG;gBACR,SAAS,EAAE,YAAE,CAAC;oBACZ,uEAAuE;oBACvE,KAAK,CAAC,SAAS;iBAChB,CAAC;aACH,CACF,CACF;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AACH,SAAwB,cAAc,CAAC,KAAK;IAC1C,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC9B,OAAO,aAAa,CAAC,kBAAK,CAAC,YAAE,EAAE;QAC7B,QAAQ,EAAE;YACR,aAAa,CAAC,iBAAI,CAAC,YAAE,EAAE;gBACrB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACf,CAAC;YACF,aAAa,CAAC,iBAAI,CAAC,KAAK,EAAE;gBACxB,SAAS,EAAE,YAAE,CAAC,CAAC,WAAW,CAAC,CAAC;gBAC5B,QAAQ,EAAE,aAAa,CAAC,iBAAI,CAAC,MAAM,EAAE;oBACnC,QAAQ,EAAE,QAAQ;iBACnB,CAAC;aACH,CAAC;SACH;KACF,CAAC,CAAC;AACL,CAAC;AAfD,iCAeC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ResolveOptions } from '../index';
|
|
2
|
-
export interface BundleOptions {
|
|
3
|
-
extract?: boolean;
|
|
4
|
-
disableExtractPlugin?: boolean;
|
|
5
|
-
mode: 'development' | 'production';
|
|
6
|
-
resolve?: ResolveOptions;
|
|
7
|
-
}
|
|
8
|
-
export declare function bundle(entry: string, { extract, disableExtractPlugin, mode, resolve }: BundleOptions): Promise<Record<string, string>>;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bundle = void 0;
|
|
7
|
-
const memfs_1 = require("memfs");
|
|
8
|
-
const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
9
|
-
const path_1 = require("path");
|
|
10
|
-
const webpack_1 = __importDefault(require("webpack"));
|
|
11
|
-
const index_1 = require("../index");
|
|
12
|
-
function bundle(entry, { extract = false, disableExtractPlugin = false, mode, resolve = {} }) {
|
|
13
|
-
const outputPath = path_1.join(__dirname, 'dist');
|
|
14
|
-
const compiler = webpack_1.default({
|
|
15
|
-
entry,
|
|
16
|
-
mode,
|
|
17
|
-
module: {
|
|
18
|
-
rules: [
|
|
19
|
-
{
|
|
20
|
-
test: /\.[jt]sx?$/,
|
|
21
|
-
exclude: /node_modules/,
|
|
22
|
-
use: [
|
|
23
|
-
{
|
|
24
|
-
loader: 'babel-loader',
|
|
25
|
-
options: {
|
|
26
|
-
babelrc: false,
|
|
27
|
-
configFile: false,
|
|
28
|
-
presets: ['@babel/preset-env', '@babel/preset-typescript', '@babel/preset-react'],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
loader: '@compiled/webpack-loader',
|
|
33
|
-
options: {
|
|
34
|
-
extract,
|
|
35
|
-
importReact: false,
|
|
36
|
-
resolve,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
test: /\.css$/i,
|
|
43
|
-
sideEffects: true,
|
|
44
|
-
use: [mini_css_extract_plugin_1.default.loader, 'css-loader'],
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
optimization: {
|
|
49
|
-
usedExports: false,
|
|
50
|
-
},
|
|
51
|
-
output: {
|
|
52
|
-
filename: '[name].js',
|
|
53
|
-
path: outputPath,
|
|
54
|
-
},
|
|
55
|
-
plugins: [
|
|
56
|
-
new mini_css_extract_plugin_1.default({ filename: 'static/[name].css' }),
|
|
57
|
-
...(disableExtractPlugin ? [] : [new index_1.CompiledExtractPlugin()]),
|
|
58
|
-
],
|
|
59
|
-
resolve: {
|
|
60
|
-
alias: {
|
|
61
|
-
'webpack-alias': path_1.join(__dirname, '..', '__fixtures__', 'lib', 'webpack-alias.ts'),
|
|
62
|
-
},
|
|
63
|
-
extensions: ['.tsx', '.ts', '.jsx', '.js'],
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
const fs = memfs_1.createFsFromVolume(new memfs_1.Volume());
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
compiler.outputFileSystem = fs;
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
compiler.intermediateFileSystem = fs;
|
|
71
|
-
return new Promise((resolve, reject) => {
|
|
72
|
-
compiler.run((err, stats) => {
|
|
73
|
-
if (err) {
|
|
74
|
-
reject(err);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) {
|
|
78
|
-
reject(stats.toJson().errors);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const assets = {};
|
|
82
|
-
Object.keys((stats === null || stats === void 0 ? void 0 : stats.compilation.assets) || {}).map((name) => {
|
|
83
|
-
const file = fs.readFileSync(path_1.join(outputPath, name), { encoding: 'utf-8' });
|
|
84
|
-
assets[name] = file;
|
|
85
|
-
});
|
|
86
|
-
resolve(assets);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
exports.bundle = bundle;
|
|
91
|
-
//# sourceMappingURL=test-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../src/__tests__/test-utils.tsx"],"names":[],"mappings":";;;;;;AAAA,iCAAmD;AACnD,sFAA2D;AAC3D,+BAA4B;AAC5B,sDAA8B;AAE9B,oCAAiD;AAUjD,SAAgB,MAAM,CACpB,KAAa,EACb,EAAE,OAAO,GAAG,KAAK,EAAE,oBAAoB,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,GAAG,EAAE,EAAiB;IAEpF,MAAM,UAAU,GAAG,WAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,iBAAO,CAAC;QACvB,KAAK;QACL,IAAI;QACJ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,YAAY;oBAClB,OAAO,EAAE,cAAc;oBACvB,GAAG,EAAE;wBACH;4BACE,MAAM,EAAE,cAAc;4BACtB,OAAO,EAAE;gCACP,OAAO,EAAE,KAAK;gCACd,UAAU,EAAE,KAAK;gCACjB,OAAO,EAAE,CAAC,mBAAmB,EAAE,0BAA0B,EAAE,qBAAqB,CAAC;6BAClF;yBACF;wBACD;4BACE,MAAM,EAAE,0BAA0B;4BAClC,OAAO,EAAE;gCACP,OAAO;gCACP,WAAW,EAAE,KAAK;gCAClB,OAAO;6BACR;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,IAAI;oBACjB,GAAG,EAAE,CAAC,iCAAoB,CAAC,MAAM,EAAE,YAAY,CAAC;iBACjD;aACF;SACF;QACD,YAAY,EAAE;YACZ,WAAW,EAAE,KAAK;SACnB;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,WAAW;YACrB,IAAI,EAAE,UAAU;SACjB;QACD,OAAO,EAAE;YACP,IAAI,iCAAoB,CAAC,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;YAC3D,GAAG,CAAC,oBAAoB,CAAC,CAAC,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