2021-10-09 10:09:06 +00:00
|
|
|
import './minify.css'
|
2022-11-28 14:34:13 +00:00
|
|
|
import './imported.css'
|
|
|
|
import './sugarss.sss'
|
|
|
|
import './sass.scss'
|
|
|
|
import './less.less'
|
|
|
|
import './stylus.styl'
|
2021-10-09 10:09:06 +00:00
|
|
|
|
2022-11-28 14:34:13 +00:00
|
|
|
import css from './imported-inline.css?inline'
|
2020-12-22 20:34:02 +00:00
|
|
|
text('.imported-css', css)
|
|
|
|
|
2022-03-25 22:47:44 +00:00
|
|
|
import rawCss from './raw-imported.css?raw'
|
|
|
|
text('.raw-imported-css', rawCss)
|
|
|
|
|
2020-12-22 20:34:02 +00:00
|
|
|
import mod from './mod.module.css'
|
2021-02-05 15:48:50 +00:00
|
|
|
document.querySelector('.modules').classList.add(mod['apply-color'])
|
2020-12-22 20:34:02 +00:00
|
|
|
text('.modules-code', JSON.stringify(mod, null, 2))
|
|
|
|
|
|
|
|
import sassMod from './mod.module.scss'
|
2021-02-05 15:48:50 +00:00
|
|
|
document.querySelector('.modules-sass').classList.add(sassMod['apply-color'])
|
2020-12-22 20:34:02 +00:00
|
|
|
text('.modules-sass-code', JSON.stringify(sassMod, null, 2))
|
|
|
|
|
2021-07-31 14:02:34 +00:00
|
|
|
import composesPathResolvingMod from './composes-path-resolving.module.css'
|
|
|
|
document
|
|
|
|
.querySelector('.path-resolved-modules-css')
|
|
|
|
.classList.add(...composesPathResolvingMod['path-resolving-css'].split(' '))
|
|
|
|
document
|
|
|
|
.querySelector('.path-resolved-modules-sass')
|
|
|
|
.classList.add(...composesPathResolvingMod['path-resolving-sass'].split(' '))
|
|
|
|
document
|
|
|
|
.querySelector('.path-resolved-modules-less')
|
|
|
|
.classList.add(...composesPathResolvingMod['path-resolving-less'].split(' '))
|
|
|
|
text(
|
|
|
|
'.path-resolved-modules-code',
|
|
|
|
JSON.stringify(composesPathResolvingMod, null, 2),
|
|
|
|
)
|
|
|
|
|
2022-04-04 10:21:02 +00:00
|
|
|
import inlineMod from './inline.module.css?inline'
|
|
|
|
text('.modules-inline', inlineMod)
|
|
|
|
|
2022-11-28 14:34:13 +00:00
|
|
|
import charset from './charset.css?inline'
|
2022-04-11 18:13:37 +00:00
|
|
|
text('.charset-css', charset)
|
|
|
|
|
2022-08-31 14:58:43 +00:00
|
|
|
import './layered/index.css'
|
|
|
|
|
2021-02-04 21:37:50 +00:00
|
|
|
import './dep.css'
|
2021-06-08 07:06:43 +00:00
|
|
|
import './glob-dep.css'
|
2021-02-04 21:37:50 +00:00
|
|
|
|
2022-08-01 05:39:26 +00:00
|
|
|
// eslint-disable-next-line import/order
|
2022-07-01 03:17:19 +00:00
|
|
|
import { barModuleClasses } from '@vitejs/test-css-js-dep'
|
|
|
|
document
|
|
|
|
.querySelector('.css-js-dep-module')
|
|
|
|
.classList.add(barModuleClasses.cssJsDepModule)
|
|
|
|
|
2020-12-22 20:34:02 +00:00
|
|
|
function text(el, text) {
|
|
|
|
document.querySelector(el).textContent = text
|
|
|
|
}
|
|
|
|
|
|
|
|
if (import.meta.hot) {
|
|
|
|
import.meta.hot.accept('./mod.module.css', (newMod) => {
|
|
|
|
const list = document.querySelector('.modules').classList
|
|
|
|
list.remove(mod.applyColor)
|
|
|
|
list.add(newMod.applyColor)
|
|
|
|
text('.modules-code', JSON.stringify(newMod.default, null, 2))
|
|
|
|
})
|
|
|
|
|
|
|
|
import.meta.hot.accept('./mod.module.scss', (newMod) => {
|
|
|
|
const list = document.querySelector('.modules-sass').classList
|
|
|
|
list.remove(mod.applyColor)
|
|
|
|
list.add(newMod.applyColor)
|
|
|
|
text('.modules-sass-code', JSON.stringify(newMod.default, null, 2))
|
|
|
|
})
|
|
|
|
}
|
2020-12-30 23:47:35 +00:00
|
|
|
|
|
|
|
// async
|
|
|
|
import('./async')
|
|
|
|
|
|
|
|
if (import.meta.env.DEV) {
|
|
|
|
import('./async-treeshaken')
|
|
|
|
}
|
2021-07-23 02:00:23 +00:00
|
|
|
|
|
|
|
// inlined
|
|
|
|
import inlined from './inlined.css?inline'
|
|
|
|
text('.inlined-code', inlined)
|
2022-02-20 13:46:26 +00:00
|
|
|
|
|
|
|
// glob
|
2022-11-28 14:34:13 +00:00
|
|
|
const glob = import.meta.glob('./glob-import/*.css', { query: '?inline' })
|
2022-05-08 08:16:44 +00:00
|
|
|
Promise.all(
|
|
|
|
Object.keys(glob).map((key) => glob[key]().then((i) => i.default)),
|
|
|
|
).then((res) => {
|
2022-02-20 13:46:26 +00:00
|
|
|
text('.imported-css-glob', JSON.stringify(res, null, 2))
|
|
|
|
})
|
|
|
|
|
|
|
|
// globEager
|
2022-11-28 14:34:13 +00:00
|
|
|
const globEager = import.meta.glob('./glob-import/*.css', {
|
|
|
|
eager: true,
|
|
|
|
query: '?inline',
|
|
|
|
})
|
2022-02-20 13:46:26 +00:00
|
|
|
text('.imported-css-globEager', JSON.stringify(globEager, null, 2))
|
2022-05-04 08:50:44 +00:00
|
|
|
|
|
|
|
import postcssSourceInput from './postcss-source-input.css?query=foo'
|
|
|
|
text('.postcss-source-input', postcssSourceInput)
|
2022-07-01 03:08:47 +00:00
|
|
|
|
|
|
|
import aliasContent from '#alias'
|
|
|
|
text('.aliased-content', aliasContent)
|
|
|
|
import aliasModule from '#alias-module'
|
|
|
|
document
|
|
|
|
.querySelector('.aliased-module')
|
|
|
|
.classList.add(aliasModule.aliasedModule)
|
2022-07-19 06:48:12 +00:00
|
|
|
|
|
|
|
import './unsupported.css'
|
2022-09-22 09:10:42 +00:00
|
|
|
|
|
|
|
import './async/index'
|