Skip to content

Commit

Permalink
Clean up Pr
Browse files Browse the repository at this point in the history
  • Loading branch information
markdoeswork committed Jan 3, 2025
1 parent dead0e8 commit a0a6b6d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 136 deletions.
52 changes: 0 additions & 52 deletions playbook/app/entrypoints/BarGraphStyles.scss

This file was deleted.

53 changes: 0 additions & 53 deletions playbook/app/pb_kits/playbook/pb_dashboard/BarGraphStyles.css

This file was deleted.

2 changes: 1 addition & 1 deletion playbook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"app/entrypoints/playbook.js",
"app/entrypoints/playbook-doc.js",
"app/entrypoints/playbook-rails-react-bindings.js",
"app/entrypoints/playbook-rails.js"
"app/entrypoints/playbook-rails.js",
]
}
60 changes: 30 additions & 30 deletions playbook/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { defineConfig } from 'vite';
import { defineConfig } from 'vite'
import { resolve } from 'path';
import RubyPlugin from 'vite-plugin-ruby';
import react from '@vitejs/plugin-react';
import copy from 'rollup-plugin-copy';
import typescript from '@rollup/plugin-typescript';
import RubyPlugin from 'vite-plugin-ruby'
import react from '@vitejs/plugin-react'
import copy from 'rollup-plugin-copy'
import typescript from '@rollup/plugin-typescript'
import consolidate from './app/javascript/rollup/consolidate-plugin';
import cssUrl from './app/javascript/rollup/css-url-plugin';
import { env } from 'process';

const isProduction = env.NODE_ENV === 'production';
const isProduction = env.NODE_ENV === 'production'

export default defineConfig({
build: {
Expand All @@ -22,25 +22,25 @@ export default defineConfig({
'chunks/vendor.js': resolve(__dirname, 'app/entrypoints/playbook.js'),
},
output: {
assetFileNames: ({ name }) => {
assetFileNames: ({name}) => {
if (name?.endsWith('.css')) {
const updatedName = name.replace('entrypoints/', '');
if (updatedName.charAt(0) === '_') return `styles/${name.slice(1)}`;
return updatedName;
const updatedName = name.replace('entrypoints/', '')
if (updatedName.charAt(0) === '_') return `styles/${name.slice(1)}`
return updatedName
}
return 'assets/[name].[ext]';
return 'assets/[name].[ext]'
},
entryFileNames: ({ name }) => {
let updatedName = `${name.replace('entrypoints/', '')}`;
const [fileName, ext] = updatedName.split('.');
if (['tsx', 'ts', 'jsx'].includes(ext)) updatedName = `${fileName}.js`;
return updatedName;
entryFileNames: ({name}) => {
let updatedName = `${name.replace('entrypoints/', '')}`
const [fileName, ext] = updatedName.split('.')
if (['tsx', 'ts', 'jsx'].includes(ext)) updatedName = `${fileName}.js`
return updatedName
},
chunkFileNames: 'chunks/[name]-[hash].js',
dir: resolve(__dirname, 'dist'),
sourcemap: !isProduction,
manualChunks: {
lib: [
'lib': [
resolve(__dirname, 'app/javascript/dashboard.js'),
resolve(__dirname, 'app/javascript/plugins.js'),
resolve(__dirname, 'app/javascript/tokens.js'),
Expand All @@ -63,7 +63,7 @@ export default defineConfig({
css: {
modules: {
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
}
},
plugins: [
react(),
Expand All @@ -79,7 +79,7 @@ export default defineConfig({
src: resolve(__dirname, 'app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss'),
dest: 'dist/pb_bar_graph/',
},
],
]
}),
typescript({
tsconfig: resolve(__dirname, 'tsconfig.json'),
Expand All @@ -89,24 +89,24 @@ export default defineConfig({
consolidate({
groups: [
{
files: [
resolve(__dirname, 'dist/playbook.css'),
resolve(__dirname, 'dist/lib.css'),
],
outputFile: resolve(__dirname, 'dist/playbook.css'),
},
files: [
resolve(__dirname, 'dist/playbook.css'),
resolve(__dirname, 'dist/lib.css'),
],
outputFile: resolve(__dirname, 'dist/playbook.css'),
}
],
}),
cssUrl(),
],
resolve: {
dedupe: ['playbook'],
alias: {
kits: resolve(__dirname, 'app/pb_kits/playbook'),
tokens: resolve(__dirname, 'app/pb_kits/playbook/tokens'),
utilities: resolve(__dirname, 'app/pb_kits/playbook/utilities'),
'kits': resolve(__dirname, 'app/pb_kits/playbook'),
'tokens': resolve(__dirname, 'app/pb_kits/playbook/tokens'),
'utilities': resolve(__dirname, 'app/pb_kits/playbook/utilities'),
'playbook-ui': resolve(__dirname, 'app/entrypoints/playbook'),
lodash: 'lodash-es',
'lodash': 'lodash-es',
},
},
});
})

0 comments on commit a0a6b6d

Please sign in to comment.