├── README.md ├── packages ├── critters │ ├── test │ │ ├── src │ │ │ ├── styles2.css │ │ │ ├── index.html │ │ │ ├── subpath-validation.html │ │ │ ├── media-validation.html │ │ │ └── styles.css │ │ ├── security.test.js │ │ ├── __snapshots__ │ │ │ └── critters.test.js.snap │ │ └── critters.test.js │ ├── src │ │ ├── text.css │ │ ├── util.js │ │ ├── index.d.ts │ │ ├── dom.js │ │ ├── css.js │ │ └── index.js │ ├── package.json │ └── README.md └── critters-webpack-plugin │ ├── test │ ├── fixtures │ │ ├── unused │ │ │ ├── index.js │ │ │ └── index.html │ │ ├── additionalStylesheets │ │ │ ├── chunk.js │ │ │ ├── style.css │ │ │ ├── additional.css │ │ │ ├── index.js │ │ │ └── index.html │ │ ├── raw │ │ │ ├── index.js │ │ │ └── index.html │ │ ├── basic │ │ │ ├── index.js │ │ │ └── index.html │ │ ├── external │ │ │ ├── index.js │ │ │ ├── index.html │ │ │ └── style.css │ │ ├── keyframes │ │ │ ├── index.js │ │ │ ├── index.html │ │ │ └── style.css │ │ └── inlineThreshold │ │ │ ├── index.js │ │ │ ├── index.html │ │ │ └── style.css │ ├── __snapshots__ │ │ ├── standalone.test.js.snap │ │ └── index.test.js.snap │ ├── standalone.test.js │ ├── _helpers.js │ └── index.test.js │ ├── src │ ├── util.js │ └── index.js │ ├── package.json │ └── README.md ├── .gitignore ├── .editorconfig ├── babel.config.js ├── CHANGELOG.md ├── .github └── workflows │ └── main.yml ├── CONTRIBUTING.md ├── package.json └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | packages/critters/README.md -------------------------------------------------------------------------------- /packages/critters/test/src/styles2.css: -------------------------------------------------------------------------------- 1 | body { 2 | height: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .DS_store 4 | next_sites 5 | coverage 6 | .vscode 7 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/unused/index.js: -------------------------------------------------------------------------------- 1 | console.log('empty file'); 2 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/additionalStylesheets/chunk.js: -------------------------------------------------------------------------------- 1 | import './additional.css'; 2 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/additionalStylesheets/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | padding: 0px; 3 | } 4 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/raw/index.js: -------------------------------------------------------------------------------- 1 | import html from './index.html'; 2 | 3 | module.exports = html; 4 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/additionalStylesheets/additional.css: -------------------------------------------------------------------------------- 1 | .additional-style { 2 | font-size: 200%; 3 | } 4 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/basic/index.js: -------------------------------------------------------------------------------- 1 | document.body.appendChild(document.createTextNode('this counts as SSR')); 2 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/external/index.js: -------------------------------------------------------------------------------- 1 | import './style.css'; 2 | 3 | document.body.appendChild(document.createTextNode('this counts as SSR')); 4 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/keyframes/index.js: -------------------------------------------------------------------------------- 1 | import './style.css'; 2 | 3 | document.body.appendChild(document.createTextNode('this counts as SSR')); 4 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/inlineThreshold/index.js: -------------------------------------------------------------------------------- 1 | import './style.css'; 2 | 3 | document.body.appendChild(document.createTextNode('this counts as SSR')); 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@babel/preset-env', 5 | { 6 | targets: { 7 | node: 'current' 8 | } 9 | } 10 | ] 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/additionalStylesheets/index.js: -------------------------------------------------------------------------------- 1 | import './style.css'; 2 | 3 | document.body.appendChild(document.createTextNode('this counts as SSR')); 4 | 5 | import('./chunk.js').then(); 6 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/keyframes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Welcome to my styled page!
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/inlineThreshold/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Welcome to my styled page!
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - uses: actions/setup-node@v1 18 | with: 19 | node-version: 18 20 | - name: install, build, test 21 | run: | 22 | yarn --frozen-lockfile 23 | yarn build 24 | yarn test 25 | env: 26 | CI: true 27 | -------------------------------------------------------------------------------- /packages/critters-webpack-plugin/test/fixtures/additionalStylesheets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Welcome to my styled page!
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /packages/critters/test/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |This is a paragraph
15 | 16 | 17 | 18 |This is a paragraph
16 | 17 | 18 | 19 |