Skip to content

Commit 10fffe4

Browse files
committed
πŸ”§ Fixed annoying warning in rollup build.
πŸ‘‰ It was due to a not yet fixed bug (pending PR), but there is a workarround: πŸ”— vladshcherbin/rollup-plugin-copy#61 (comment)
1 parent 06a01e8 commit 10fffe4

7 files changed

+616
-648
lines changed

β€Ždist/SmarkForm.esm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/SmarkForm.esm.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/SmarkForm.umd.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/SmarkForm.umd.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage-lock.json

+599-636
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"rollup": "^4.24.2",
5757
"rollup-plugin-cleanup": "^3.2.1",
5858
"rollup-plugin-copy": "^3.5.0",
59+
"rollup-plugin-del": "^1.0.1",
5960
"sass": "^1.83.1"
6061
},
6162
"browserslist": "> 0.25%, not dead",

β€Žrollup.config.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import cleanup from 'rollup-plugin-cleanup';
33
import terser from '@rollup/plugin-terser';
44
import pug from './rollup-plugins/rollup-plugin-pug.js';
55
import sass from './rollup-plugins/rollup-plugin-sass.js';
6+
import del from 'rollup-plugin-del'
67
import copy from 'rollup-plugin-copy'
78
import { readFileSync, promises as fs } from 'fs';
89
import path from 'path';
@@ -14,6 +15,12 @@ const pkg = JSON.parse(readFileSync('./package.json'));
1415
const isProduction = process.env.BUILD === 'production';
1516

1617

18+
const delTargets = [
19+
"dist/*",
20+
"docs/_resources/dist",
21+
"docs/_data/package.json",
22+
];
23+
1724
const copyTargets = [
1825
{ src: "package.json", dest: "docs/_data/" },
1926
{ src: "dist/*", dest: "docs/_resources/dist" },
@@ -67,6 +74,10 @@ export default [
6774
},
6875
],
6976
plugins: [
77+
del({
78+
targets: delTargets,
79+
runOnce: true,
80+
}),
7081
babel({
7182
babelHelpers: 'bundled',
7283
presets: [
@@ -90,14 +101,7 @@ export default [
90101
}),
91102
copy({
92103
targets: copyTargets,
93-
...(
94-
! isProduction ? {hook: "writeBundle"}
95-
// Copies files after every rebuild making jekyll site
96-
// to reload while in dev (watch) mode.
97-
// BUT makes 'npm run build' to fail.
98-
// This (almost) fixes that...
99-
: {}
100-
)
104+
copyOnce: true,
101105
}),
102106
]
103107
},

0 commit comments

Comments
Β (0)