├── babel.config.js
├── src
├── constants.js
├── modules
│ └── fs.js
├── parseCustomConfig.js
├── main.js
└── observer.js
├── .gitignore
├── README.md
├── LICENSE
├── public
└── index.html
├── package.json
└── vue.config.js
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/src/constants.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | VIRTUAL_SOURCE_PATH: "/sourcePath",
3 | VIRTUAL_HTML_FILENAME: "/htmlInput",
4 | };
5 |
--------------------------------------------------------------------------------
/src/modules/fs.js:
--------------------------------------------------------------------------------
1 | let i = 0
2 |
3 | module.exports = {
4 | statSync: () => {
5 | return { mtimeMs: ++i }
6 | },
7 | readFileSync: (id) => self[id] || '',
8 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 | pnpm-debug.log*
14 |
15 | # Editor directories and files
16 | .idea
17 | .vscode
18 | *.suo
19 | *.ntvs*
20 | *.njsproj
21 | *.sln
22 | *.sw?
23 |
24 | .vercel
--------------------------------------------------------------------------------
/src/parseCustomConfig.js:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line no-unused-vars
2 | const colors = require("tailwindcss/colors");
3 |
4 | export default () => {
5 | let userConfig = {};
6 |
7 | try {
8 | let customConfig = document.querySelector('script[type="tailwind-config"]').innerText;
9 |
10 | userConfig = eval(`(${customConfig})`) || {};
11 | } catch (err) {
12 | //
13 | }
14 |
15 | return userConfig;
16 | };
17 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import observerScript from "./observer";
2 |
3 | (() => {
4 | const config = {
5 | attributes: true,
6 | attributeFilter: ["class"],
7 | childList: true,
8 | subtree: true,
9 | };
10 |
11 | new MutationObserver(observerScript(false)).observe(
12 | document.documentElement,
13 | config
14 | );
15 |
16 | observerScript();
17 |
18 | window.tailwindCSS = {
19 | refresh: observerScript(true),
20 | }
21 | })();
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Tailwind JIT CDN
2 |
3 | Use the full power of Tailwind CSS' new JIT compiler by including one script tag to your HTML.
4 |
5 | ## Usage:
6 |
7 | Just include this script tag into your site:
8 |
9 | ```
10 |
11 | ```
12 |
13 | You can learn all about this package in our [in-depth blog post](https://beyondco.de/blog/tailwind-jit-compiler-via-cdn).
14 |
15 | ## Support Us
16 |
17 | [](https://usewindy.com)
18 |
19 | We spend a lot of time working on our [free developer services](https://beyondco.de/services) or open source packages. You can support our work by [buying one of our paid products](https://beyondco.de/software).
20 |
21 | ## Credits
22 |
23 | - [Marcel Pociot](https://github.com/mpociot)
24 | - [All Contributors](../../contributors)
25 |
26 | ## License
27 |
28 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Beyond Code
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
12 |
17 |
18 |
19 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Autem soluta, quos a dolores voluptas et necessitatibus consequuntur omnis neque repellat unde, reprehenderit nam vero harum sit quaerat qui. Rem, illo!
20 |