mirror of
https://github.com/JosunLP/BrowserExtensionTemplate.git
synced 2025-10-14 08:00:11 +00:00

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
71 lines
2 KiB
TypeScript
71 lines
2 KiB
TypeScript
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',
|
|
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,
|
|
},
|
|
});
|