@compiled/webpack-loader 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/__fixtures__/babel.d.ts +1 -0
  2. package/dist/__fixtures__/babel.js.map +1 -1
  3. package/dist/__fixtures__/binding-not-found.d.ts +1 -1
  4. package/dist/__fixtures__/binding-not-found.js +6 -9
  5. package/dist/__fixtures__/binding-not-found.js.map +1 -1
  6. package/dist/__fixtures__/common/css-prop.d.ts +1 -1
  7. package/dist/__fixtures__/common/css-prop.js +3 -6
  8. package/dist/__fixtures__/common/css-prop.js.map +1 -1
  9. package/dist/__fixtures__/compiled-error.d.ts +1 -0
  10. package/dist/__fixtures__/compiled-error.js +4 -7
  11. package/dist/__fixtures__/compiled-error.js.map +1 -1
  12. package/dist/__fixtures__/important-styles.d.ts +1 -1
  13. package/dist/__fixtures__/important-styles.js +3 -6
  14. package/dist/__fixtures__/important-styles.js.map +1 -1
  15. package/dist/__fixtures__/lib/loader-alias.js +1 -1
  16. package/dist/__fixtures__/lib/loader-alias.js.map +1 -1
  17. package/dist/__fixtures__/lib/webpack-alias.js +1 -1
  18. package/dist/__fixtures__/lib/webpack-alias.js.map +1 -1
  19. package/dist/__fixtures__/loader-alias.d.ts +1 -0
  20. package/dist/__fixtures__/loader-alias.js +5 -5
  21. package/dist/__fixtures__/loader-alias.js.map +1 -1
  22. package/dist/__fixtures__/local-styles.d.ts +1 -0
  23. package/dist/__fixtures__/local-styles.js +7 -9
  24. package/dist/__fixtures__/local-styles.js.map +1 -1
  25. package/dist/__fixtures__/relative-styles.d.ts +2 -2
  26. package/dist/__fixtures__/relative-styles.js +8 -10
  27. package/dist/__fixtures__/relative-styles.js.map +1 -1
  28. package/dist/__fixtures__/webpack-alias.d.ts +1 -0
  29. package/dist/__fixtures__/webpack-alias.js +5 -5
  30. package/dist/__fixtures__/webpack-alias.js.map +1 -1
  31. package/dist/compiled-loader.js +20 -11
  32. package/dist/compiled-loader.js.map +1 -1
  33. package/dist/css-loader.js +4 -1
  34. package/dist/css-loader.js.map +1 -1
  35. package/dist/extract-plugin.js +20 -22
  36. package/dist/extract-plugin.js.map +1 -1
  37. package/dist/types.d.ts +9 -0
  38. package/dist/utils.d.ts +1 -1
  39. package/package.json +15 -12
  40. package/src/__fixtures__/babel.tsx +1 -0
  41. package/src/__fixtures__/binding-not-found.tsx +2 -1
  42. package/src/__fixtures__/common/css-prop.tsx +3 -2
  43. package/src/__fixtures__/compiled-error.tsx +2 -2
  44. package/src/__fixtures__/important-styles.tsx +2 -2
  45. package/src/__fixtures__/lib/babel-cjs.d.ts +3 -0
  46. package/src/__fixtures__/lib/babel-esm.d.ts +3 -0
  47. package/src/__fixtures__/loader-alias.tsx +4 -4
  48. package/src/__fixtures__/local-styles.tsx +5 -4
  49. package/src/__fixtures__/relative-styles.tsx +6 -4
  50. package/src/__fixtures__/webpack-alias.tsx +4 -4
  51. package/src/__tests__/compiled-loader.test.tsx +1 -0
  52. package/src/__tests__/extract-plugin.test.tsx +12 -17
  53. package/src/__tests__/test-utils.tsx +3 -2
  54. package/src/compiled-loader.tsx +17 -5
  55. package/src/css-loader.tsx +5 -1
  56. package/src/extract-plugin.tsx +3 -2
  57. package/src/types.tsx +11 -0
  58. package/src/utils.tsx +1 -1
  59. package/CHANGELOG.md +0 -127
  60. package/dist/__fixtures__/lib/babel-cjs.d.ts +0 -3
  61. package/dist/__fixtures__/lib/babel-cjs.js +0 -129
  62. package/dist/__fixtures__/lib/babel-cjs.js.map +0 -1
  63. package/dist/__fixtures__/lib/babel-esm.d.ts +0 -1
  64. package/dist/__fixtures__/lib/babel-esm.js +0 -128
  65. package/dist/__fixtures__/lib/babel-esm.js.map +0 -1
  66. package/dist/__tests__/test-utils.d.ts +0 -8
  67. package/dist/__tests__/test-utils.js +0 -91
  68. package/dist/__tests__/test-utils.js.map +0 -1
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@compiled/webpack-loader",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "A familiar and performant compile time CSS-in-JS library for React.",
5
- "homepage": "https://compiledcssinjs.com",
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",
7
7
  "repository": {
8
8
  "type": "git",
@@ -17,15 +17,15 @@
17
17
  "files": [
18
18
  "css-loader",
19
19
  "dist",
20
- "src",
21
- "README.md"
20
+ "src"
22
21
  ],
23
22
  "dependencies": {
24
- "@babel/core": "^7.16.0",
25
- "@compiled/babel-plugin": "^0.11.0",
26
- "@compiled/babel-plugin-strip-runtime": "^0.6.13",
27
- "@compiled/css": "^0.7.0",
28
- "@compiled/utils": "^0.6.11",
23
+ "@babel/core": "^7.16.7",
24
+ "@compiled/babel-plugin": "^0.12.0",
25
+ "@compiled/babel-plugin-strip-runtime": "^0.11.4",
26
+ "@compiled/css": "^0.8.1",
27
+ "@compiled/react": "0.10.2",
28
+ "@compiled/utils": "^0.6.14",
29
29
  "enhanced-resolve": "^5.8.3",
30
30
  "loader-utils": "^2.0.2",
31
31
  "webpack-sources": "^1.4.3"
@@ -33,9 +33,12 @@
33
33
  "devDependencies": {
34
34
  "babel-loader": "^8.2.3",
35
35
  "css-loader": "^5.2.7",
36
- "memfs": "^3.2.4",
37
- "mini-css-extract-plugin": "^1.5.0",
38
- "webpack": "^5.61.0"
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.66.0"
39
42
  },
40
43
  "peerDependencies": {
41
44
  "webpack": ">= 4.46.0"
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+
2
3
  import BabelCJS from './lib/babel-cjs';
3
4
  import BabelESM from './lib/babel-esm';
4
5
 
@@ -1,5 +1,6 @@
1
+ /** @jsx jsx */
2
+ import { jsx, styled } from '@compiled/react';
1
3
  import React from 'react';
2
- import { styled } from '@compiled/react';
3
4
 
4
5
  const height = '9rem';
5
6
 
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
- import '@compiled/react';
1
+ /** @jsx jsx */
2
+ import { jsx } from '@compiled/react';
3
+
3
4
  import { coral } from './colors';
4
5
 
5
6
  export const Coral = (): JSX.Element => (
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { css } from '@compiled/react';
1
+ /** @jsx jsx */
2
+ import { jsx, css } from '@compiled/react';
3
3
 
4
4
  // @ts-expect-error
5
5
  const styles = css(false);
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import '@compiled/react';
1
+ /** @jsx jsx */
2
+ import { jsx } from '@compiled/react';
3
3
 
4
4
  const Component = (): JSX.Element => <div css={{ fontSize: '12!important', color: 'blue' }} />;
5
5
 
@@ -0,0 +1,3 @@
1
+ declare const Component: () => JSX.Element;
2
+
3
+ export default Component;
@@ -0,0 +1,3 @@
1
+ declare const Component: () => JSX.Element;
2
+
3
+ export default Component;
@@ -1,8 +1,8 @@
1
- import React from 'react';
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
- import React from 'react';
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
- import React from 'react';
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
- import React from 'react';
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
 
@@ -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
- expect(Object.keys(actual)).toMatchInlineSnapshot(`
84
- Array [
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';
@@ -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';
@@ -25,6 +26,8 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
25
26
  importReact = undefined,
26
27
  nonce = undefined,
27
28
  resolve = {},
29
+ extensions = undefined,
30
+ babelPlugins = [],
28
31
  }: CompiledLoaderOptions = typeof context.getOptions === 'undefined'
29
32
  ? // Webpack v4 flow
30
33
  getOptions(context)
@@ -47,6 +50,12 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
47
50
  resolve: {
48
51
  type: 'object',
49
52
  },
53
+ extensions: {
54
+ type: 'array',
55
+ },
56
+ babelPlugins: {
57
+ type: 'array',
58
+ },
50
59
  },
51
60
  });
52
61
 
@@ -56,6 +65,8 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
56
65
  importReact,
57
66
  nonce,
58
67
  resolve,
68
+ extensions,
69
+ babelPlugins,
59
70
  };
60
71
  }
61
72
 
@@ -150,7 +161,8 @@ export default async function compiledLoader(
150
161
  }
151
162
 
152
163
  callback(null, output, result?.map ?? undefined);
153
- } catch (e) {
164
+ } catch (e: unknown) {
165
+ // @ts-expect-error Not checking for error type
154
166
  const error = createError('compiled-loader', 'Unhandled exception')(e.stack);
155
167
  callback(error);
156
168
  }
@@ -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].path !== __filename) {
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
  }
@@ -1,6 +1,7 @@
1
1
  import { sort } from '@compiled/css';
2
- import { toBoolean, createError } from '@compiled/utils';
3
- import type { Compiler, Compilation } from 'webpack';
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/types.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ import type { ParserPlugin } from '@babel/parser';
1
2
  import type { ResolveOptions, RuleSetCondition } from 'webpack';
2
3
 
3
4
  export type { ResolveOptions };
@@ -31,6 +32,16 @@ export interface CompiledLoaderOptions {
31
32
  * Override the default `resolve` passed into webpack, which is used to statically evaluate import declarations
32
33
  */
33
34
  resolve?: ResolveOptions;
35
+
36
+ /**
37
+ * List of file extensions to traverse as code
38
+ */
39
+ extensions?: string[];
40
+
41
+ /**
42
+ * List of babel plugins to be applied to evaluated files
43
+ */
44
+ babelPlugins?: ParserPlugin[];
34
45
  }
35
46
 
36
47
  export interface CompiledExtractPluginOptions {
package/src/utils.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import type { Compiler, Compilation as CompilationType, sources } from 'webpack';
1
+ import type { Compilation as CompilationType, Compiler, sources } from 'webpack';
2
2
 
3
3
  /**
4
4
  * Gets the normal module hook for webpack 4 & webpack 5.
package/CHANGELOG.md DELETED
@@ -1,127 +0,0 @@
1
- # @compiled/webpack-loader
2
-
3
- ## 0.7.2
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [e015a3a]
8
- - Updated dependencies [fa6af90]
9
- - @compiled/babel-plugin@0.11.0
10
-
11
- ## 0.7.1
12
-
13
- ### Patch Changes
14
-
15
- - Updated dependencies [b68411c]
16
- - Updated dependencies [53a3d71]
17
- - @compiled/babel-plugin@0.10.0
18
-
19
- ## 0.7.0
20
-
21
- ### Minor Changes
22
-
23
- - 0b60ae1: Use webpack resolution and add custom `resolve` override
24
-
25
- ### Patch Changes
26
-
27
- - Updated dependencies [0b60ae1]
28
- - Updated dependencies [2092839]
29
- - @compiled/babel-plugin@0.9.0
30
-
31
- ## 0.6.17
32
-
33
- ### Patch Changes
34
-
35
- - Updated dependencies [53935b3]
36
- - @compiled/babel-plugin@0.8.0
37
-
38
- ## 0.6.16
39
-
40
- ### Patch Changes
41
-
42
- - Updated dependencies [bcb2a68]
43
- - Updated dependencies [a7ab8e1]
44
- - Updated dependencies [e1dc346]
45
- - Updated dependencies [bcb2a68]
46
- - Updated dependencies [48805ec]
47
- - Updated dependencies [587e729]
48
- - @compiled/babel-plugin@0.7.0
49
- - @compiled/css@0.7.0
50
-
51
- ## 0.6.15
52
-
53
- ### Patch Changes
54
-
55
- - 40bc0d9: Package descriptions have been updated.
56
- - Updated dependencies [40bc0d9]
57
- - Updated dependencies [1b1c964]
58
- - Updated dependencies [1b1c964]
59
- - @compiled/babel-plugin@0.6.13
60
- - @compiled/babel-plugin-strip-runtime@0.6.13
61
- - @compiled/css@0.6.11
62
- - @compiled/utils@0.6.11
63
-
64
- ## 0.6.14
65
-
66
- ### Patch Changes
67
-
68
- - ad512ec: Fixed extraction when `!important` styles were found.
69
-
70
- ## 0.6.13
71
-
72
- ### Patch Changes
73
-
74
- - 6a7261e: Programmatic babel use now searches upwards for a project root, and if found will use that config. This fixes issues in some monorepo setups.
75
- - 8a13ee9: The loader now only errors once when running without the webpack extract plugin.
76
- - Updated dependencies [b92eb6d]
77
- - @compiled/babel-plugin-strip-runtime@0.6.11
78
-
79
- ## 0.6.12
80
-
81
- ### Patch Changes
82
-
83
- - 4032cd4: The `importReact` option now correctly defaults to `true`.
84
-
85
- ## 0.6.11
86
-
87
- ### Patch Changes
88
-
89
- - 37108e4: Fixed webpack 4 flow throwing unexpectedly.
90
- - 37108e4: Added missing babel dependency.
91
- - 37108e4: Fixed css loader entrypoint not making its way to npm.
92
- - 37108e4: Compiled dependencies are now using carat range.
93
- - 37108e4: Fixed bug picking up an unexpected asset during webpack compilation.
94
- - Updated dependencies [992e401]
95
- - Updated dependencies [37108e4]
96
- - @compiled/utils@0.6.10
97
- - @compiled/babel-plugin@0.6.10
98
- - @compiled/css@0.6.10
99
-
100
- ## 0.6.10
101
-
102
- ### Patch Changes
103
-
104
- - 660309a: Support for webpack 4 has been added, follow the [extraction guide](https://compiledcssinjs.com/docs/css-extraction-webpack) to get started.
105
-
106
- ## 0.6.9
107
-
108
- ### Patch Changes
109
-
110
- - 0bb1c11: Added new option `extract` with pairing webpack plugin `CompiledExtractPlugin`.
111
- Configuring them will strip all the runtime from your app and extract all styles to an atomic style sheet.
112
-
113
- For help getting started with this feature read the [CSS extraction guide](https://compiledcssinjs.com/docs/css-extraction-webpack) for webpack.
114
-
115
- - Updated dependencies [0bb1c11]
116
- - Updated dependencies [0bb1c11]
117
- - @compiled/css@0.6.9
118
- - @compiled/utils@0.6.9
119
- - @compiled/babel-plugin@0.6.9
120
-
121
- ## 0.6.8
122
-
123
- ### Patch Changes
124
-
125
- - aea3504: Packages now released with [changesets](https://github.com/atlassian/changesets).
126
- - Updated dependencies [aea3504]
127
- - @compiled/babel-plugin@0.6.8
@@ -1,3 +0,0 @@
1
- export var __esModule: boolean;
2
- export default BabelComponent;
3
- declare function BabelComponent(_ref2: any): any;
@@ -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