demos: revert switch to modules only

This commit is contained in:
Philipp Kühn
2021-09-30 11:43:51 +02:00
parent b2a08e4a78
commit fc9a8febbc
5 changed files with 15 additions and 47 deletions

View File

@@ -2,7 +2,6 @@
"name": "tiptap-demos",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"start": "vite --host",
"build": "yarn ts && vite build",
@@ -10,6 +9,7 @@
},
"dependencies": {
"d3": "^7.0.4",
"fast-glob": "^3.2.7",
"remixicon": "^2.5.0",
"shiki": "^0.9.11",
"simplify-js": "^1.2.4",
@@ -23,7 +23,6 @@
"@vitejs/plugin-react-refresh": "^1.3.6",
"@vitejs/plugin-vue": "^1.9.2",
"autoprefixer": "^10.3.6",
"globby": "^12.0.2",
"iframe-resizer": "^4.3.2",
"postcss": "^8.3.8",
"react": "^17.0.2",

View File

@@ -1,10 +1,6 @@
import tailwind from 'tailwindcss'
import autoprefixer from 'autoprefixer'
import tailwindConfig from './tailwind.config.js'
export default {
plugins: [
tailwind(tailwindConfig),
autoprefixer,
],
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@@ -1,6 +1,6 @@
import defaultTheme from 'tailwindcss/defaultTheme.js'
const defaultTheme = require('tailwindcss/defaultTheme')
export default {
module.exports = {
mode: 'jit',
purge: [
'./preview/**/*.{vue,js,ts,jsx,tsx}',

View File

@@ -6,11 +6,10 @@ import {
} from 'path'
import { v4 as uuid } from 'uuid'
import fs from 'fs'
import { globbySync } from 'globby'
import fg from 'fast-glob'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import reactRefresh from '@vitejs/plugin-react-refresh'
import postcss from './postcss.config.js'
// import checker from 'vite-plugin-checker'
const includeDependencies = fs.readFileSync('./includeDependencies.txt')
@@ -24,13 +23,9 @@ export default defineConfig({
include: includeDependencies,
},
css: {
postcss,
},
build: {
rollupOptions: {
input: globbySync('./**/index.html', {
input: fg.sync('./**/index.html', {
ignore: ['dist'],
}),
},
@@ -73,10 +68,10 @@ export default defineConfig({
},
load(id) {
if (id === '@demos') {
const demos = globbySync('./src/*/*', { onlyDirectories: true })
const demos = fg.sync('./src/*/*', { onlyDirectories: true })
.map(demoPath => {
const name = demoPath.replace('./src/', '')
const tabs = globbySync(`./src/${name}/*`, { onlyDirectories: true })
const tabs = fg.sync(`./src/${name}/*`, { onlyDirectories: true })
.map(tabPath => ({
name: basename(tabPath),
}))
@@ -102,7 +97,7 @@ export default defineConfig({
load(id) {
if (id.startsWith('source!')) {
const path = id.split('!!')[0].replace('source!', '')
const files = globbySync(`${path}/**/*`, {
const files = fg.sync(`${path}/**/*`, {
ignore: [
'**/index.html',
'**/*.spec.js',
@@ -167,7 +162,7 @@ export default defineConfig({
resolve: {
alias: [
...globbySync('../packages/*', { onlyDirectories: true })
...fg.sync('../packages/*', { onlyDirectories: true })
.map(name => name.replace('../packages/', ''))
.map(name => {
return { find: `@tiptap/${name}`, replacement: resolve(`../packages/${name}/src/index.ts`) }