Skip to content

Commit b974239

Browse files
authored
Merge pull request #37 from esarbanis/allow-options-override
Allow for `shared` and `format` options to be overridden
2 parents 42dbc20 + c6ed795 commit b974239

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ module.exports = function(source, map) {
5959
const isProduction = this.minimize || process.env.NODE_ENV === 'production';
6060

6161
options.filename = this.resourcePath;
62-
options.format = this.version === 1 ? options.format || 'cjs' : 'es';
63-
options.shared =
64-
options.format === 'es' && 'svelte/shared.js';
62+
if (!options.format) {
63+
options.format = this.version === 1 ? options.format || 'cjs' : 'es';
64+
}
65+
if (!options.shared) {
66+
options.shared = options.format === 'es' && 'svelte/shared.js';
67+
}
6568

6669
if (options.emitCss) options.css = false;
6770

0 commit comments

Comments
 (0)