@compiled/webpack-loader 0.7.1 → 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__/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__/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.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 +16 -11
- 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 +20 -22
- package/dist/extract-plugin.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/utils.d.ts +1 -1
- package/package.json +16 -13
- 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 +12 -5
- package/src/css-loader.tsx +5 -1
- package/src/extract-plugin.tsx +3 -2
- package/src/types.tsx +5 -0
- package/src/utils.tsx +1 -1
- package/CHANGELOG.md +0 -119
- 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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
"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,25 +17,28 @@
|
|
|
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.
|
|
25
|
-
"@compiled/babel-plugin": "^0.
|
|
26
|
-
"@compiled/babel-plugin-strip-runtime": "^0.
|
|
27
|
-
"@compiled/css": "^0.
|
|
28
|
-
"@compiled/
|
|
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",
|
|
28
|
+
"@compiled/utils": "^0.6.14",
|
|
29
29
|
"enhanced-resolve": "^5.8.3",
|
|
30
|
-
"loader-utils": "^2.0.
|
|
30
|
+
"loader-utils": "^2.0.2",
|
|
31
31
|
"webpack-sources": "^1.4.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"babel-loader": "^8.2.3",
|
|
35
35
|
"css-loader": "^5.2.7",
|
|
36
|
-
"memfs": "^3.
|
|
37
|
-
"mini-css-extract-plugin": "^1.
|
|
38
|
-
"
|
|
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"
|
|
39
42
|
},
|
|
40
43
|
"peerDependencies": {
|
|
41
44
|
"webpack": ">= 4.46.0"
|
|
@@ -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';
|
|
@@ -25,6 +26,7 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
|
|
|
25
26
|
importReact = undefined,
|
|
26
27
|
nonce = undefined,
|
|
27
28
|
resolve = {},
|
|
29
|
+
extensions = undefined,
|
|
28
30
|
}: CompiledLoaderOptions = typeof context.getOptions === 'undefined'
|
|
29
31
|
? // Webpack v4 flow
|
|
30
32
|
getOptions(context)
|
|
@@ -47,6 +49,9 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
|
|
|
47
49
|
resolve: {
|
|
48
50
|
type: 'object',
|
|
49
51
|
},
|
|
52
|
+
extensions: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
},
|
|
50
55
|
},
|
|
51
56
|
});
|
|
52
57
|
|
|
@@ -56,6 +61,7 @@ function getLoaderOptions(context: LoaderContext<CompiledLoaderOptions>) {
|
|
|
56
61
|
importReact,
|
|
57
62
|
nonce,
|
|
58
63
|
resolve,
|
|
64
|
+
extensions,
|
|
59
65
|
};
|
|
60
66
|
}
|
|
61
67
|
|
|
@@ -150,7 +156,8 @@ export default async function compiledLoader(
|
|
|
150
156
|
}
|
|
151
157
|
|
|
152
158
|
callback(null, output, result?.map ?? undefined);
|
|
153
|
-
} catch (e) {
|
|
159
|
+
} catch (e: unknown) {
|
|
160
|
+
// @ts-expect-error Not checking for error type
|
|
154
161
|
const error = createError('compiled-loader', 'Unhandled exception')(e.stack);
|
|
155
162
|
callback(error);
|
|
156
163
|
}
|
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/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 {
|
package/src/utils.tsx
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# @compiled/webpack-loader
|
|
2
|
-
|
|
3
|
-
## 0.7.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [b68411c]
|
|
8
|
-
- Updated dependencies [53a3d71]
|
|
9
|
-
- @compiled/babel-plugin@0.10.0
|
|
10
|
-
|
|
11
|
-
## 0.7.0
|
|
12
|
-
|
|
13
|
-
### Minor Changes
|
|
14
|
-
|
|
15
|
-
- 0b60ae1: Use webpack resolution and add custom `resolve` override
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- Updated dependencies [0b60ae1]
|
|
20
|
-
- Updated dependencies [2092839]
|
|
21
|
-
- @compiled/babel-plugin@0.9.0
|
|
22
|
-
|
|
23
|
-
## 0.6.17
|
|
24
|
-
|
|
25
|
-
### Patch Changes
|
|
26
|
-
|
|
27
|
-
- Updated dependencies [53935b3]
|
|
28
|
-
- @compiled/babel-plugin@0.8.0
|
|
29
|
-
|
|
30
|
-
## 0.6.16
|
|
31
|
-
|
|
32
|
-
### Patch Changes
|
|
33
|
-
|
|
34
|
-
- Updated dependencies [bcb2a68]
|
|
35
|
-
- Updated dependencies [a7ab8e1]
|
|
36
|
-
- Updated dependencies [e1dc346]
|
|
37
|
-
- Updated dependencies [bcb2a68]
|
|
38
|
-
- Updated dependencies [48805ec]
|
|
39
|
-
- Updated dependencies [587e729]
|
|
40
|
-
- @compiled/babel-plugin@0.7.0
|
|
41
|
-
- @compiled/css@0.7.0
|
|
42
|
-
|
|
43
|
-
## 0.6.15
|
|
44
|
-
|
|
45
|
-
### Patch Changes
|
|
46
|
-
|
|
47
|
-
- 40bc0d9: Package descriptions have been updated.
|
|
48
|
-
- Updated dependencies [40bc0d9]
|
|
49
|
-
- Updated dependencies [1b1c964]
|
|
50
|
-
- Updated dependencies [1b1c964]
|
|
51
|
-
- @compiled/babel-plugin@0.6.13
|
|
52
|
-
- @compiled/babel-plugin-strip-runtime@0.6.13
|
|
53
|
-
- @compiled/css@0.6.11
|
|
54
|
-
- @compiled/utils@0.6.11
|
|
55
|
-
|
|
56
|
-
## 0.6.14
|
|
57
|
-
|
|
58
|
-
### Patch Changes
|
|
59
|
-
|
|
60
|
-
- ad512ec: Fixed extraction when `!important` styles were found.
|
|
61
|
-
|
|
62
|
-
## 0.6.13
|
|
63
|
-
|
|
64
|
-
### Patch Changes
|
|
65
|
-
|
|
66
|
-
- 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.
|
|
67
|
-
- 8a13ee9: The loader now only errors once when running without the webpack extract plugin.
|
|
68
|
-
- Updated dependencies [b92eb6d]
|
|
69
|
-
- @compiled/babel-plugin-strip-runtime@0.6.11
|
|
70
|
-
|
|
71
|
-
## 0.6.12
|
|
72
|
-
|
|
73
|
-
### Patch Changes
|
|
74
|
-
|
|
75
|
-
- 4032cd4: The `importReact` option now correctly defaults to `true`.
|
|
76
|
-
|
|
77
|
-
## 0.6.11
|
|
78
|
-
|
|
79
|
-
### Patch Changes
|
|
80
|
-
|
|
81
|
-
- 37108e4: Fixed webpack 4 flow throwing unexpectedly.
|
|
82
|
-
- 37108e4: Added missing babel dependency.
|
|
83
|
-
- 37108e4: Fixed css loader entrypoint not making its way to npm.
|
|
84
|
-
- 37108e4: Compiled dependencies are now using carat range.
|
|
85
|
-
- 37108e4: Fixed bug picking up an unexpected asset during webpack compilation.
|
|
86
|
-
- Updated dependencies [992e401]
|
|
87
|
-
- Updated dependencies [37108e4]
|
|
88
|
-
- @compiled/utils@0.6.10
|
|
89
|
-
- @compiled/babel-plugin@0.6.10
|
|
90
|
-
- @compiled/css@0.6.10
|
|
91
|
-
|
|
92
|
-
## 0.6.10
|
|
93
|
-
|
|
94
|
-
### Patch Changes
|
|
95
|
-
|
|
96
|
-
- 660309a: Support for webpack 4 has been added, follow the [extraction guide](https://compiledcssinjs.com/docs/css-extraction-webpack) to get started.
|
|
97
|
-
|
|
98
|
-
## 0.6.9
|
|
99
|
-
|
|
100
|
-
### Patch Changes
|
|
101
|
-
|
|
102
|
-
- 0bb1c11: Added new option `extract` with pairing webpack plugin `CompiledExtractPlugin`.
|
|
103
|
-
Configuring them will strip all the runtime from your app and extract all styles to an atomic style sheet.
|
|
104
|
-
|
|
105
|
-
For help getting started with this feature read the [CSS extraction guide](https://compiledcssinjs.com/docs/css-extraction-webpack) for webpack.
|
|
106
|
-
|
|
107
|
-
- Updated dependencies [0bb1c11]
|
|
108
|
-
- Updated dependencies [0bb1c11]
|
|
109
|
-
- @compiled/css@0.6.9
|
|
110
|
-
- @compiled/utils@0.6.9
|
|
111
|
-
- @compiled/babel-plugin@0.6.9
|
|
112
|
-
|
|
113
|
-
## 0.6.8
|
|
114
|
-
|
|
115
|
-
### Patch Changes
|
|
116
|
-
|
|
117
|
-
- aea3504: Packages now released with [changesets](https://github.com/atlassian/changesets).
|
|
118
|
-
- Updated dependencies [aea3504]
|
|
119
|
-
- @compiled/babel-plugin@0.6.8
|
|
@@ -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,MAA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