mirror of
https://github.com/JosunLP/BrowserExtensionTemplate.git
synced 2025-10-14 16:10:10 +00:00
feat: Implement ErrorBoundary class for global error handling
feat: Refactor Session class to use LocalStorageService for session management feat: Enhance BasicButton component with configuration options and event handling style: Update SASS variables to CSS custom properties for better theming support style: Modify app.sass to include Bootstrap with legacy import chore: Update settings.ts to handle session initialization and error notifications fix: Improve buttonType definition for better readability chore: Refactor parse.ts for cleaner file handling and keyword replacement chore: Enhance syncConfig.ts with TypeScript interfaces and async file operations chore: Update v2.ts to modify manifest.json for compatibility with manifest version 2 chore: Revise tsconfig.json for stricter type checking and improved module resolution chore: Refactor vite.config.ts for better build configuration and asset management
This commit is contained in:
parent
8f99895c88
commit
482151f980
24 changed files with 1321 additions and 418 deletions
|
@ -1,28 +1,71 @@
|
|||
import { defineConfig } from "vite";
|
||||
import { resolve } from "path";
|
||||
import tsconfigPaths from "vite-tsconfig-paths";
|
||||
import { resolve } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
app: resolve(__dirname, "src/app.ts"),
|
||||
settings: resolve(__dirname, "src/settings.ts"),
|
||||
background: resolve(__dirname, "src/background.ts"),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: "[name].js",
|
||||
dir: resolve(__dirname, "dist"),
|
||||
},
|
||||
},
|
||||
sourcemap: true,
|
||||
},
|
||||
plugins: [tsconfigPaths()],
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".scss", ".sass"],
|
||||
},
|
||||
esbuild: {
|
||||
include: /.*\.tsx?$/,
|
||||
exclude: [/node_modules/, /dist/],
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
app: resolve(__dirname, 'src/app.ts'),
|
||||
settings: resolve(__dirname, 'src/settings.ts'),
|
||||
background: resolve(__dirname, 'src/background.ts'),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: '[name].js',
|
||||
chunkFileNames: 'chunks/[name]-[hash].js',
|
||||
assetFileNames: assetInfo => {
|
||||
if (assetInfo.name?.endsWith('.css')) {
|
||||
return 'assets/[name]-[hash][extname]';
|
||||
}
|
||||
return 'assets/[name]-[hash][extname]';
|
||||
},
|
||||
dir: resolve(__dirname, 'dist'),
|
||||
},
|
||||
},
|
||||
sourcemap: true,
|
||||
target: 'es2022',
|
||||
minify: 'esbuild',
|
||||
reportCompressedSize: false,
|
||||
chunkSizeWarningLimit: 1000,
|
||||
},
|
||||
plugins: [tsconfigPaths()],
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss', '.sass'],
|
||||
alias: {
|
||||
'@': resolve(__dirname, './src'),
|
||||
'@components': resolve(__dirname, './src/components'),
|
||||
'@classes': resolve(__dirname, './src/classes'),
|
||||
'@types': resolve(__dirname, './src/types'),
|
||||
'@sass': resolve(__dirname, './src/sass'),
|
||||
},
|
||||
},
|
||||
esbuild: {
|
||||
target: 'es2022',
|
||||
include: /.*\.tsx?$/,
|
||||
exclude: [/node_modules/, /dist/],
|
||||
legalComments: 'none',
|
||||
},
|
||||
define: {
|
||||
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development'),
|
||||
__VERSION__: JSON.stringify(process.env.npm_package_version || '0.0.1'),
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
sass: {
|
||||
additionalData: `@import "@sass/_root.sass"\n@import "@sass/_mixin.sass"\n`,
|
||||
quietDeps: true,
|
||||
verbose: false,
|
||||
charset: false,
|
||||
silenceDeprecations: [
|
||||
'import',
|
||||
'global-builtin',
|
||||
'color-functions',
|
||||
'legacy-js-api',
|
||||
'mixed-decls',
|
||||
'slash-div',
|
||||
],
|
||||
},
|
||||
},
|
||||
devSourcemap: true,
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue