├── docs ├── examples │ ├── cli │ │ ├── .gitignore │ │ ├── src │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── package.json │ │ └── README.md │ ├── cli-typescript │ │ ├── .gitignore │ │ ├── src │ │ │ ├── index.css │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── README.md │ │ └── package.json │ ├── react-ssr-webpack-typescript │ │ ├── src │ │ │ ├── app │ │ │ │ ├── components │ │ │ │ │ ├── a.component.css │ │ │ │ │ ├── b.component.css │ │ │ │ │ ├── a.component.tsx │ │ │ │ │ └── b.component.tsx │ │ │ │ └── app.component.tsx │ │ │ ├── index-client.tsx │ │ │ ├── global.d.ts │ │ │ └── index-server.tsx │ │ ├── tsconfig.json │ │ ├── webpack.config.js │ │ ├── package.json │ │ ├── test │ │ │ └── index.ts │ │ └── README.md │ ├── lit-element-webpack-typescript │ │ ├── src │ │ │ ├── index.css │ │ │ ├── global.d.ts │ │ │ └── index.ts │ │ ├── index.html │ │ ├── tsconfig.json │ │ ├── webpack.config.js │ │ ├── package.json │ │ ├── test │ │ │ └── index.ts │ │ └── README.md │ ├── sidebar.md │ └── README.md ├── CHANGELOG.md ├── css-es-modules │ ├── CHANGELOG.md │ ├── sidebar.md │ └── README.md ├── postcss-node │ ├── sidebar.md │ └── README.md ├── api │ ├── sidebar.md │ ├── index.md │ ├── postcss-node-loader.getformat.md │ ├── postcss-node-loader.transformsource.md │ ├── postcss-node.md │ ├── css-es-modules.css_global_key.md │ ├── css-es-modules.css_locals_key.md │ ├── postcss-node-loader.md │ ├── css-es-modules.stylescollector.raw.md │ ├── postcss-es-modules.options.modules.md │ ├── css-es-modules.defaultstylesinjectoptions.md │ ├── css-es-modules.stylescollector.ids.md │ ├── postcss-es-modules.options.inject.md │ ├── postcss-es-modules.postcssesmodules.md │ ├── css-es-modules.stylesinjectoptions.usenounce.md │ ├── css-es-modules.stylescollector.html.md │ ├── README.md │ ├── css-es-modules.collectstyles.md │ ├── css-es-modules.stylesinjectoptions.usenodeglobal.md │ ├── postcss-es-modules.modulesoptions.hashprefix.md │ ├── postcss-es-modules.modulesoptions.exportglobals.md │ ├── postcss-es-modules.modulesoptions.attachoriginalclassname.md │ ├── postcss-es-modules.modulesoptions.scopebehaviour.md │ ├── postcss-es-modules.extendedstylesinjectoptions.scripttype.md │ ├── postcss-es-modules.modulesoptions.globalmodulepaths.md │ ├── postcss-es-modules.extendedstylesinjectoptions.moduletype.md │ ├── postcss-es-modules.modulesoptions.localsconvention.md │ ├── postcss-es-modules.extendedstylesinjectoptions.scriptejectpath.md │ ├── postcss-es-modules.extendedstylesinjectoptions.custom.md │ ├── css-es-modules.stylesinjectoptions.useconstructablestylesheet.md │ ├── css-es-modules.stylesinjectoptions.usestyletag.md │ ├── postcss-es-modules.modulesoptions.generatescopedname.md │ ├── postcss-es-modules.md │ ├── css-es-modules.stylescollector.md │ ├── postcss-node.register.md │ ├── postcss-es-modules.options.md │ ├── postcss-es-modules.extendedstylesinjectoptions.script.md │ ├── postcss-es-modules.extendedstylesinjectoptions.injectmode.md │ ├── css-es-modules.injectstyles.md │ ├── css-es-modules.md │ ├── css-es-modules.stylesinjectoptions.md │ ├── postcss-es-modules.modulesoptions.md │ └── postcss-es-modules.extendedstylesinjectoptions.md ├── sidebar.md ├── sidebar_examples_internal.md └── index.html ├── packages ├── postcss-node │ ├── test │ │ ├── test3.css │ │ ├── test1.css │ │ ├── test4.bcss │ │ ├── test4.ccss │ │ ├── test2.css │ │ ├── test5.css │ │ ├── test6.css │ │ └── index.spec.ts │ ├── register.js │ ├── src │ │ ├── index.ts │ │ └── lib │ │ │ ├── options.ts │ │ │ ├── worker-init.ts │ │ │ ├── types.ts │ │ │ ├── worker.ts │ │ │ ├── register.ts │ │ │ └── worker-sync-function.ts │ ├── index.js │ ├── postcss.config.js │ ├── api-extractor.json │ ├── tsconfig.json │ ├── README.md │ └── package.json ├── postcss-node-loader │ ├── test │ │ ├── test1.css │ │ ├── test.js │ │ └── .postcssrc.json │ ├── index.js │ ├── api-extractor.json │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ └── package.json ├── css-es-modules │ ├── src │ │ ├── index.ts │ │ ├── collect-styles.ts │ │ ├── collect-styles.spec.ts │ │ ├── inject-styles.ts │ │ └── inject-styles.spec.ts │ ├── api-extractor.json │ ├── tsconfig.json │ ├── README.md │ └── package.json └── postcss-es-modules │ ├── index.js │ ├── src │ ├── index.ts │ └── lib │ │ ├── utils │ │ ├── read-code-for-embed.spec.ts │ │ ├── read-code-for-embed.ts │ │ ├── runtime-options.spec.ts │ │ └── runtime-options.ts │ │ ├── builders │ │ ├── import-statement.ts │ │ ├── import-statement.spec.ts │ │ ├── styles-statement.ts │ │ └── styles-statement.spec.ts │ │ ├── eject.ts │ │ ├── plugin.ts │ │ ├── eject.spec.ts │ │ ├── options.ts │ │ ├── stringify.ts │ │ └── plugin.spec.ts │ ├── api-extractor.json │ ├── tsconfig.json │ └── package.json ├── .gitignore ├── package.json ├── .github └── workflows │ └── build.yml └── README.md /docs/examples/cli/.gitignore: -------------------------------------------------------------------------------- 1 | *.css-module.js 2 | -------------------------------------------------------------------------------- /packages/postcss-node/test/test3.css: -------------------------------------------------------------------------------- 1 | error text file 2 | -------------------------------------------------------------------------------- /docs/examples/cli-typescript/.gitignore: -------------------------------------------------------------------------------- 1 | *.css-module.ts 2 | -------------------------------------------------------------------------------- /docs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - initial implementation 4 | -------------------------------------------------------------------------------- /packages/postcss-node/test/test1.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: blue; 3 | } -------------------------------------------------------------------------------- /packages/postcss-node/test/test4.bcss: -------------------------------------------------------------------------------- 1 | .a { 2 | color: blue; 3 | } -------------------------------------------------------------------------------- /packages/postcss-node/test/test4.ccss: -------------------------------------------------------------------------------- 1 | .a { 2 | color: blue; 3 | } -------------------------------------------------------------------------------- /packages/postcss-node/register.js: -------------------------------------------------------------------------------- 1 | require('./index.js').register(); 2 | -------------------------------------------------------------------------------- /packages/postcss-node/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/register'; 2 | -------------------------------------------------------------------------------- /packages/postcss-node/test/test2.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /packages/postcss-node/test/test5.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /docs/examples/cli/src/index.css: -------------------------------------------------------------------------------- 1 | .title { 2 | font-size: 24px; 3 | } 4 | -------------------------------------------------------------------------------- /packages/postcss-node-loader/test/test1.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: blue; 3 | } -------------------------------------------------------------------------------- /docs/css-es-modules/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - initial implementation 4 | -------------------------------------------------------------------------------- /packages/postcss-node-loader/index.js: -------------------------------------------------------------------------------- 1 | export * from './dist/dist-esm/index.js'; 2 | -------------------------------------------------------------------------------- /packages/postcss-node/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./dist/dist-cjs'); 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .nyc_output 3 | node_modules 4 | dist 5 | coverage 6 | temp 7 | -------------------------------------------------------------------------------- /docs/examples/cli-typescript/src/index.css: -------------------------------------------------------------------------------- 1 | .title { 2 | font-size: 24px; 3 | } 4 | -------------------------------------------------------------------------------- /packages/postcss-node-loader/test/test.js: -------------------------------------------------------------------------------- 1 | import * as styles from './test1.css'; 2 | console.log(styles); 3 | -------------------------------------------------------------------------------- /docs/examples/react-ssr-webpack-typescript/src/app/components/a.component.css: -------------------------------------------------------------------------------- 1 | .aComponent { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /docs/examples/react-ssr-webpack-typescript/src/app/components/b.component.css: -------------------------------------------------------------------------------- 1 | .bComponent { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /docs/examples/lit-element-webpack-typescript/src/index.css: -------------------------------------------------------------------------------- 1 | /* simple example css file */ 2 | .app { 3 | color: red; 4 | } 5 | -------------------------------------------------------------------------------- /docs/examples/lit-element-webpack-typescript/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/examples/cli-typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "CommonJS", 4 | "target": "ES5", 5 | "skipLibCheck": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/css-es-modules/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './collect-styles'; 2 | export * from './inject-styles' 3 | import { injectStyles } from './inject-styles'; 4 | export default injectStyles; 5 | -------------------------------------------------------------------------------- /packages/postcss-es-modules/index.js: -------------------------------------------------------------------------------- 1 | const { postcssEsModules } = require('./dist/dist-cjs/index.js'); 2 | module.exports = postcssEsModules; 3 | module.exports.postcssEsModules = postcssEsModules; 4 | -------------------------------------------------------------------------------- /packages/postcss-node/src/lib/options.ts: -------------------------------------------------------------------------------- 1 | export const defaultPostCssNodeExtensions = ['.css', '.scss', '.sass', '.less', '.stylus']; 2 | export const defaultResponseTimeout = 60000; 3 | export const defaultBufferSize = 1024; 4 | -------------------------------------------------------------------------------- /packages/postcss-node-loader/test/.postcssrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": { 3 | "postcss-es-modules": { 4 | "inject": { 5 | "moduleType": "esm" 6 | } 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/postcss-node/sidebar.md: -------------------------------------------------------------------------------- 1 | * [Overview](../) 2 | * [Examples](../examples/) 3 | * Utility packages 4 | * [css-es-modules](../css-es-modules/) 5 | * [postcss-node](./) 6 | * [Changelog](../CHANGELOG.md) 7 | * [Api reference](../api/) 8 | -------------------------------------------------------------------------------- /docs/api/sidebar.md: -------------------------------------------------------------------------------- 1 | * [Overview](../) 2 | * [Examples](../examples/) 3 | * Utility packages 4 | * [css-es-modules](../css-es-modules/) 5 | * [postcss-node](../postcss-node/) 6 | * [Changelog](../CHANGELOG.md) 7 | * [Api reference](./) 8 | 9 | -------------------------------------------------------------------------------- /docs/css-es-modules/sidebar.md: -------------------------------------------------------------------------------- 1 | * [Overview](../) 2 | * [Examples](../examples/) 3 | * Utility packages 4 | * [css-es-modules](./) 5 | * [postcss-node](../postcss-node/) 6 | * [Changelog](../CHANGELOG.md) 7 | * [Api reference](../api/) 8 | 9 | -------------------------------------------------------------------------------- /docs/examples/sidebar.md: -------------------------------------------------------------------------------- 1 | * [Overview](../) 2 | * [Examples](.) 3 | * Utility packages 4 | * [css-es-modules](../css-es-modules/) 5 | * [postcss-node](../postcss-node/) 6 | * [Changelog](../CHANGELOG.md) 7 | * [Api reference](../api/) 8 | 9 | -------------------------------------------------------------------------------- /docs/sidebar.md: -------------------------------------------------------------------------------- 1 | * [Overview](.) 2 | * [Examples](./examples/) 3 | * Utility packages 4 | * [css-es-modules](./css-es-modules/) 5 | * [postcss-node](./postcss-node/) 6 | * [Changelog](./CHANGELOG.md) 7 | * [Api reference](./api/) 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/sidebar_examples_internal.md: -------------------------------------------------------------------------------- 1 | * [Overview](../../) 2 | * [Examples](../) 3 | * [example](./) 4 | * Utility packages 5 | * [css-es-modules](../../css-es-modules/) 6 | * [postcss-node](../../postcss-node/) 7 | * [Changelog](../../CHANGELOG.md) 8 | * [Api reference](../../api/) 9 | -------------------------------------------------------------------------------- /docs/api/index.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [Home](./index.md) 4 | 5 | ## API Reference 6 | 7 | ## Packages 8 | 9 | | Package | Description | 10 | | --- | --- | 11 | | [postcss-es-modules](./postcss-es-modules.md) | | 12 | 13 | -------------------------------------------------------------------------------- /docs/examples/react-ssr-webpack-typescript/src/app/components/a.component.tsx: -------------------------------------------------------------------------------- 1 | import { createElement } from 'react'; 2 | import styles from './a.component.css'; 3 | 4 | export const AComponent = () => { 5 | return(
13 | filename: string,
14 | timeout: number,
15 | bufferSize: number): (inputData: P) => R {
16 | let worker: Worker | undefined;
17 | let terminateTimeout: any;
18 | return (inputData: P): R => {
19 | if (terminateTimeout) {
20 | clearTimeout(terminateTimeout);
21 | }
22 | if (!worker) {
23 | const initBuffer = new SharedArrayBuffer(initBufferSize)
24 | const initSemaphore = new Int32Array(initBuffer);
25 | worker = workerInit(filename, { sharedBuffer: initBuffer });
26 | const initResponse = Atomics.wait(initSemaphore, 0, 0, 5000);
27 | /* istanbul ignore if */
28 | if (initResponse === 'timed-out') {
29 | throw 'Worker init timeout';
30 | }
31 | }
32 | const messageBuffer = new SharedArrayBuffer(bufferSize * 1024)
33 | const messageSemaphore = new Int32Array(messageBuffer);
34 | worker.postMessage({
35 | ...inputData,
36 | messageBuffer
37 | });
38 | const response = Atomics.wait(messageSemaphore, 0, 0, timeout);
39 | terminateTimeout = setTimeout(() => {
40 | /* istanbul ignore else */
41 | if (worker) {
42 | worker.terminate()
43 | worker = undefined;
44 | terminateTimeout = undefined;
45 | }
46 | });
47 | /* istanbul ignore if */
48 | if (response === 'timed-out') {
49 | throw 'Worker timeout';
50 | }
51 | const length = messageSemaphore[0];
52 | return v8.deserialize(Buffer.from(messageBuffer, INT32_BYTES, length));
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/packages/postcss-es-modules/src/lib/eject.ts:
--------------------------------------------------------------------------------
1 | import { join } from 'path';
2 | import { Options } from './options';
3 | import { promises, existsSync } from 'fs';
4 |
5 | let isEjecting = false;
6 |
7 | /**
8 | * Eject the loader code.
9 | * @internal
10 | */
11 | export const eject = async (options: RequiredgenerateScopedName: "[name]__[local]___[hash:base64:5]" |
22 | | [globalModulePaths?](./postcss-es-modules.modulesoptions.globalmodulepaths.md) | Array<string \| RegExp> | (Optional) To define paths for global modules, use the globalModulePaths option. It is an array with regular expressions defining the paths: |
23 | | [hashPrefix?](./postcss-es-modules.modulesoptions.hashprefix.md) | string | (Optional) It's possible to add custom hash to generate more unique classes using the hashPrefix option. |
24 | | [localsConvention?](./postcss-es-modules.modulesoptions.localsconvention.md) | 'camelCase' \| 'camelCaseOnly' \| 'dashes' \| 'dashesOnly' \| ((originalClassName: string, generatedClassName: string, inputFile: string) => string) | (Optional) Style of exported classnames. |
25 | | [scopeBehaviour?](./postcss-es-modules.modulesoptions.scopebehaviour.md) | 'global' \| 'local' | (Optional) By default, the plugin assumes that all the classes are local. You can change this behaviour using the scopeBehaviour option. |
26 |
27 |
--------------------------------------------------------------------------------
/packages/postcss-node-loader/src/index.ts:
--------------------------------------------------------------------------------
1 | import postcss from "postcss";
2 | import postcssrc from 'postcss-load-config';
3 | import { env } from 'process';
4 |
5 | type TransformSourceFn = (
6 | originalSource: { toStrong(): string },
7 | context: { url: string },
8 | defaultTransformSource: TransformSourceFn
9 | ) => Promise<{ source: string }>;
10 |
11 | type GetFormatFn = (
12 | url: string,
13 | context: { url: string },
14 | defaultGetFormat: GetFormatFn
15 | ) => { format: string }
16 |
17 | const defaultPostCssNodeExtensions = ['.css', '.scss', '.sass', '.less', '.stylus'];
18 | const extensions: Arraylazy - the stylesheet will be injected on the first use of the style class name within the code - ondemand - the stylesheet will be injected only when the styles.inject() method will be called - instant - the stylesheet will be injected on the module load - none - the stylesheet will be never injected, to inject it to the DOM you will need to import css content Default: 'lazy' |
22 | | [moduleType?](./postcss-es-modules.extendedstylesinjectoptions.moduletype.md) | 'esm' \| 'cjs' | (Optional) Generated code modules type. Options: - 'esm' - ecmascript 6 modules - 'cjs' - commonjsDefault 'esm' |
23 | | [script?](./postcss-es-modules.extendedstylesinjectoptions.script.md) | 'embed' \| 'eject' \| 'import' | (Optional) The way how the styles injector script will be referred from the generated source. Options: - embed: embedding loader script in the target source - eject: the loader script will be ejected to the provided scriptEjectPath - import: the loader script will be referred by the import statementDefault: 'import' |
24 | | [scriptEjectPath?](./postcss-es-modules.extendedstylesinjectoptions.scriptejectpath.md) | string | (Optional) The path where the script code will be ejected. This option is required if 'eject' value is set for the script type. |
25 | | [scriptType?](./postcss-es-modules.extendedstylesinjectoptions.scripttype.md) | 'ts' \| 'js' | (Optional) The script type. Options: - ts: typescript - js: javascriptDefault: 'js' |
26 |
27 |
--------------------------------------------------------------------------------
/docs/examples/react-ssr-webpack-typescript/test/index.ts:
--------------------------------------------------------------------------------
1 | import * as assert from 'assert';
2 | import { launch, Page } from 'puppeteer';
3 | import { server } from '../dist/index-server';
4 |
5 | const getColorOfElement = async (page: Page, selector: string) => {
6 | const element = await page.$(selector);
7 | return page.evaluate(el => getComputedStyle(el).color, element);
8 | }
9 |
10 | const getAdoptedStyleSheetsCount = async (page: Page) =>
11 | page.evaluate(() => document['adoptedStyleSheets'].length);
12 |
13 |
14 | const getStyleTag = async (page: Page) => {
15 | const styles = await page.$('style');
16 | return page.evaluate(el => [
17 | el.sheet.rules.length,
18 | el.sheet.rules[0]?.style?.color,
19 | el.sheet.rules[1]?.style?.color
20 | ], styles);
21 | };
22 |
23 |
24 | (async () => {
25 | try {
26 | // running server
27 | await new Promise(res => server.on('listening', res));
28 |
29 | // prepare browser
30 | const browser = await launch();
31 | const page = await browser.newPage();
32 |
33 | // testing of ssr of aComponent and csr of bComponent
34 |
35 | await page.goto(`http://localhost:3001`, {waitUntil: 'networkidle2'});
36 |
37 | assert.deepStrictEqual(await getStyleTag(page), [1, 'blue', null],
38 | 'styles only for aComponent on the page');
39 |
40 | assert.strictEqual(await getColorOfElement(page, 'div#aComponent'), 'rgb(0, 0, 255)',
41 | 'aComponent is blue');
42 |
43 | assert.strictEqual(await getAdoptedStyleSheetsCount(page), 0,
44 | 'no adoptedStyleSheets as styles prerendered');
45 |
46 | // opening second component
47 | const button = await page.$('button');
48 | await button.click();
49 |
50 | assert.strictEqual(await getAdoptedStyleSheetsCount(page), 1,
51 | 'added adoptedStyleSheets');
52 |
53 | assert.strictEqual(await getColorOfElement(page, 'div#bComponent'), 'rgb(255, 0, 0)',
54 | 'bComponent is red');
55 |
56 |
57 | // testing of ssr of aComponent and bComponent
58 |
59 | await page.goto(`http://localhost:3001?showBComponent=true`, {waitUntil: 'networkidle2'});
60 |
61 | assert.deepStrictEqual(await getStyleTag(page), [2, 'blue', 'red'],
62 | 'styles for aComponent and bComponent are on the page');
63 |
64 | assert.strictEqual(await getColorOfElement(page, 'div#aComponent'), 'rgb(0, 0, 255)',
65 | 'aComponent is blue');
66 |
67 | assert.strictEqual(await getColorOfElement(page, 'div#bComponent'), 'rgb(255, 0, 0)',
68 | 'bComponent is red');
69 |
70 | assert.strictEqual(await getAdoptedStyleSheetsCount(page), 0,
71 | 'no adoptedStyleSheets as styles prerendered');
72 |
73 | await browser.close();
74 | server.close();
75 | } catch (ex) {
76 | console.error(ex);
77 | process.exit(1);
78 | }
79 | process.exit(0);
80 | })();
81 |
--------------------------------------------------------------------------------
/docs/examples/react-ssr-webpack-typescript/README.md:
--------------------------------------------------------------------------------
1 | # React example
2 | Example of usage postcss-es-modules with the React library, typescript and webpack.
3 |
4 | This is example of small application with the server and client side rendering.
5 | In this example we have two components, we can prerender both or the single component
6 | on server side, and we are sure that only referred styles are prerendered on server side.
7 | We can also run the second component on client side, and then the component will
8 | inject own styles it to the DOM.
9 |
10 | This example is using webpack and typescript.
11 |
12 | ## running
13 | ```bash
14 | yarn run
15 | ```
16 |
17 | ## project structure
18 | ```
19 | ├── src
20 | │ ├── app // isomorphic application code
21 | │ │ ├── components // ui components
22 | │ │ │ ├── a.component.css // styles of component A
23 | │ │ │ ├── a.component.tsx // component A
24 | │ │ │ ├── b.component.css // styles of component B
25 | │ │ │ └── b.component.tsx // component B
26 | │ │ └── app.component.tsx // application component
27 | │ ├── global.d.ts // global types declaration
28 | │ ├── index.scss // scss source code
29 | │ ├── index-client.ts // client side entry point
30 | │ └── index-server.ts // server side entry point
31 | ├── package.json // project package.json
32 | ├── tsconfig.json // minimal typescript config
33 | └── webpack.config.js // minimal webpack config
34 | ```
35 |
36 | ## ./src/app/components/a.component.css
37 |
38 | [./src/app/components/a.component.css](./src/app/components/a.component.css ':include :type=code')
39 |
40 | ## ./src/app/components/a.component.tsx
41 |
42 | [./src/app/components/a.component.tsx](./src/app/components/a.component.tsx ':include :type=code')
43 |
44 | ## ./src/app/components/b.component.css
45 |
46 | [./src/app/components/b.component.css](./src/app/components/b.component.css ':include :type=code')
47 |
48 | ## ./src/app/components/b.component.tsx
49 |
50 | [./src/app/components/b.component.tsx](./src/app/components/b.component.tsx ':include :type=code')
51 |
52 | ## ./src/app/app.component.tsx
53 |
54 | [./src/app/app.component.tsx](./src/app/app.component.tsx ':include :type=code')
55 |
56 | ## ./src/global.d.ts
57 |
58 | [./src/global.d.ts ](./src/global.d.ts ':include :type=code')
59 |
60 |
61 | ## ./src/index-client.tsx
62 |
63 | [./src/index-client.tsx](./src/index-client.tsx ':include :type=code')
64 |
65 | ## ./src/index-server.tsx
66 |
67 | [./src/index-server.tsx](./src/index-server.tsx ':include :type=code')
68 |
69 |
70 |
71 | ## ./package.json
72 |
73 | [./package.json](./package.json ':include :type=code')
74 |
75 | > Please notice the settings for the plugin. As we are using the lit-element build-in styles injection
76 | > we are using injection mode `none`.
77 |
78 | ## ./tsconfig.json
79 |
80 | [./tsconfig.json](./tsconfig.json ':include :type=code')
81 |
82 | ## ./webpack.config.js
83 |
84 | [./webpack.config.js](./webpack.config.js ':include :type=code')
85 |
--------------------------------------------------------------------------------
/packages/postcss-es-modules/src/lib/builders/styles-statement.ts:
--------------------------------------------------------------------------------
1 | import { Builder, Root } from 'postcss';
2 |
3 | function getResolvedClassName(classMap: Record