WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5ccdc3b

Browse files
fix svelte 4 issues
* update svelte-select * remove format options as the default value is now esm anyways * fix the default order of the plugins for better module resolution * define exportConditions especially browser. this fixes the issue that onMount methods were not executed thus the loader was not hidden after loading was completed.
1 parent 49e75e0 commit 5ccdc3b

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"image-capture": "^0.4.0",
2727
"lodash-es": "^4.17.21",
2828
"sirv-cli": "^1.0.0",
29-
"svelte-select": "^3.17.0"
29+
"svelte-select": "^4.0.0"
3030
}
3131
}

rollup.config.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,25 @@ export default {
3333
input: 'src/main.js',
3434
output: {
3535
sourcemap: true,
36-
format: 'esm',
3736
name: 'app',
3837
dir: 'public/',
3938
entryFileNames: production ? 'build/[name]-[hash].js' : 'build/[name].js',
4039
chunkFileNames: production ? 'build/[name]-[hash].js' : 'build/[name].js',
4140
assetFileNames: production ? 'build/[name]-[hash].[ext]' : 'build/[name].[ext]'
4241
},
4342
plugins: [
44-
commonjs(),
4543
svelte({
4644
compilerOptions: {
4745
// enable run-time checks when not in production
4846
dev: !production,
49-
format: 'esm'
5047
}
5148
}),
49+
resolve({
50+
browser: true,
51+
dedupe: ['svelte'],
52+
exportConditions: ['svelte', 'browser']
53+
}),
54+
commonjs(),
5255
styles({
5356
mode: ["extract", "styles.css"],
5457
minimize: true,
@@ -174,18 +177,6 @@ export default {
174177
</html>`
175178
}
176179
}),
177-
178-
// If you have external dependencies installed from
179-
// npm, you'll most likely need these plugins. In
180-
// some cases you'll need additional configuration -
181-
// consult the documentation for details:
182-
// https://github.com/rollup/plugins/tree/master/packages/commonjs
183-
resolve({
184-
browser: true,
185-
dedupe: ['svelte']
186-
}),
187-
// commonjs(),
188-
189180
// In dev mode, call `npm run start` once
190181
// the bundle has been generated
191182
!production && serve(),

0 commit comments

Comments
 (0)