Skip to content

Commit

Permalink
πŸ”§ Fixed annoying warning in rollup build.
Browse files Browse the repository at this point in the history
  πŸ‘‰ It was due to a not yet fixed bug (pending PR), but there is a
     workarround:

    πŸ”— vladshcherbin/rollup-plugin-copy#61 (comment)
  • Loading branch information
bitifet committed Jan 8, 2025
1 parent 06a01e8 commit 10fffe4
Show file tree
Hide file tree
Showing 7 changed files with 616 additions and 648 deletions.
2 changes: 1 addition & 1 deletion dist/SmarkForm.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/SmarkForm.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/SmarkForm.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/SmarkForm.umd.js.map

Large diffs are not rendered by default.

1,235 changes: 599 additions & 636 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"rollup": "^4.24.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-del": "^1.0.1",
"sass": "^1.83.1"
},
"browserslist": "> 0.25%, not dead",
Expand Down
20 changes: 12 additions & 8 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cleanup from 'rollup-plugin-cleanup';
import terser from '@rollup/plugin-terser';
import pug from './rollup-plugins/rollup-plugin-pug.js';
import sass from './rollup-plugins/rollup-plugin-sass.js';
import del from 'rollup-plugin-del'
import copy from 'rollup-plugin-copy'
import { readFileSync, promises as fs } from 'fs';
import path from 'path';
Expand All @@ -14,6 +15,12 @@ const pkg = JSON.parse(readFileSync('./package.json'));
const isProduction = process.env.BUILD === 'production';


const delTargets = [
"dist/*",
"docs/_resources/dist",
"docs/_data/package.json",
];

const copyTargets = [
{ src: "package.json", dest: "docs/_data/" },
{ src: "dist/*", dest: "docs/_resources/dist" },
Expand Down Expand Up @@ -67,6 +74,10 @@ export default [
},
],
plugins: [
del({
targets: delTargets,
runOnce: true,
}),
babel({
babelHelpers: 'bundled',
presets: [
Expand All @@ -90,14 +101,7 @@ export default [
}),
copy({
targets: copyTargets,
...(
! isProduction ? {hook: "writeBundle"}
// Copies files after every rebuild making jekyll site
// to reload while in dev (watch) mode.
// BUT makes 'npm run build' to fail.
// This (almost) fixes that...
: {}
)
copyOnce: true,
}),
]
},
Expand Down

0 comments on commit 10fffe4

Please sign in to comment.