Skip to content

Commit

Permalink
feat: extract css into there own files
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoubza Younes authored and KHOUBZA Younes committed Jun 5, 2023
1 parent 76c6e33 commit 9be34fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/sweetalert/src/sweetalert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
QueueableInterface,
} from '@flasher/flasher';

import Swal, { SweetAlertOptions } from 'sweetalert2';
import Swal from 'sweetalert2/dist/sweetalert2.js';
import { SweetAlertOptions } from 'sweetalert2';
import 'sweetalert2/dist/sweetalert2.min.css';

type SwalType = typeof Swal;
Expand Down
4 changes: 4 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
targets: ['dist'],
}),
styles({
mode: 'extract',
plugins: {
cssnano,
"postcss-discard-comments": {
Expand All @@ -58,12 +59,14 @@ export default {
format: 'cjs',
exports: 'auto',
sourcemap: !isProduction,
assetFileNames: '[name][extname]',
},
{
file: module.output,
format: 'umd',
exports: 'auto',
sourcemap: !isProduction,
assetFileNames: '[name][extname]',
name: module.name,
globals: module.globals || {},
},
Expand All @@ -72,6 +75,7 @@ export default {
format: 'umd',
exports: 'auto',
sourcemap: !isProduction,
assetFileNames: '[name][extname]',
name: module.name,
globals: module.globals || {},
plugins: [
Expand Down

0 comments on commit 9be34fa

Please sign in to comment.