Skip to content

sweetalert2/sweetalert2-parcel-demo

Repository files navigation

Demonstration of using SweetAlert2 with parcel

app.js

import Swal from 'sweetalert2/dist/sweetalert2.js'

import './styles.scss'

Swal.fire('Hello from parcel!')

styles.scss

$swal2-font-size: 1.2rem;

// default SweetAlert2 styles
// @import 'sweetalert2/src/sweetalert2.scss';

// Dark theme https://github.com/sweetalert2/sweetalert2-themes
@import '@sweetalert2/themes/dark/dark.scss';

index.html

<script src="./dist/app.js"></script>
<link href="./dist/app.css" rel="stylesheet">

Compile

$ parcel build app.js