summaryrefslogtreecommitdiff
path: root/rolldown.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'rolldown.config.js')
-rw-r--r--rolldown.config.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/rolldown.config.js b/rolldown.config.js
deleted file mode 100644
index 6cc7765..0000000
--- a/rolldown.config.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import { rolldown } from 'rolldown';
-import fs from 'fs-extra';
-import path from 'path';
-
-const production = process.env.NODE_ENV === 'production';
-
-async function build() {
- try {
- await fs.remove('dist');
- await fs.ensureDir('dist');
-
- const jsBundle = await rolldown({
- input: 'src/js/script.ts',
- output: {
- file: 'dist/bundle.js',
- format: 'es',
- sourcemap: !production,
- },
- });
-
- await jsBundle.write();
-
- await fs.copy('src/css/style.css', 'dist/bundle.css');
- await fs.copy('src/assets', 'dist', {
- overwrite: true,
- });
-
- let html = await fs.readFile('src/index.html', 'utf8');
- await fs.writeFile('dist/index.html', html);
- } catch (err) {
- console.error('Build failed:', err);
- process.exit(1);
- }
-}
-
-build();