Skip to content

Commit

Permalink
[plugin-svelte] fix the dev option for dependencies (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Sep 26, 2020
1 parent 95857f0 commit af3c6c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/plugin-svelte/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ const fs = require('fs');
const path = require('path');

module.exports = function plugin(snowpackConfig, pluginOptions = {}) {
const isDev = process.env.NODE_ENV !== "production";

// Support importing Svelte files when you install dependencies.
snowpackConfig.installOptions.rollup.plugins.push(
svelteRollupPlugin({include: '**/node_modules/**'}),
svelteRollupPlugin({include: '**/node_modules/**', dev: isDev}),
);

let svelteOptions;
Expand All @@ -20,7 +22,7 @@ module.exports = function plugin(snowpackConfig, pluginOptions = {}) {
}
// Generate svelte options from user provided config (if given)
svelteOptions = {
dev: process.env.NODE_ENV !== 'production',
dev: isDev,
css: false,
...svelteOptions,
...pluginOptions,
Expand Down

1 comment on commit af3c6c5

@vercel
Copy link

@vercel vercel bot commented on af3c6c5 Sep 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.