demos: revert switch to modules only
This commit is contained in:
@@ -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`) }
|
||||
|
||||
Reference in New Issue
Block a user